Skip to content

ledangtuanbk/mariadb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mariadb

set enviroment variable

export MARIADB=/srv/mariadb

and add previous line to .bashrc file

custom mariadb version 10.4.7

run

docker run --name CONTAINER_NAME --restart=always -v VOLUME_NAME:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=1 -d -p 3306:3306 ledangtuanbk/mariadb:10.4.7

backup

docker exec -t CONTAINER_NAME mysqldump -u root -p MYSQL_ROOT_PASSWORD DATABASE_NAME > /mnt/backup_date +%d-%m-%Y"_"%H_%M_%S.sql

Restore

cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root -p MYSQL_ROOT_PASSWORD DATABASE_NAME

Docker compose docker-compose.yml

version: '3.3'
services:
    mariadb:
        container_name: mariadb
        restart: always
        volumes:
            - '$MARIADB_HOME/data:/var/lib/mysql'
#            - '$MARIADB_HOME/mysql:/etc/mysql'
        environment:
            - MYSQL_ROOT_PASSWORD=1
        ports:
            - '3306:3306'
        image: 'ledangtuanbk/mariadb:10.4.7'

.env

MARIADB_HOME=/srv/mariadb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published