Skip to content

josecelano/docker-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

My notes about using MySQL with docker

This is just a collection of scripts, tutorials, links, articles, commands or any other resource about using docker for MySQL or MariaDB. Because I have to search for it again adn again every time I need it.

MySQL8

WARNING: We are not using a persisted volume. If you remove the volume used by the container you lose the database data.

Run the docker container and connect using the console client:

./bin/start_mysql.sh
./bin/mysql_client.sh

Commands using your client

How to run commands using the console client.

Run the client:

mysql -h127.0.0.1 -uroot -pdb-root-password

Run a SQL sentence:

mysql -h127.0.0.1 -uroot -pdb-root-password torrust_v1 < ./your.sql

Commands using the dockerized client

Run a SQL sentence:

docker exec -i torrust-index-backend-mysql mysql torrust_v1 -uroot -pdb-root-password < ./your.sql

Other commands

Backup DB:

mysqldump -h127.0.0.1 torrust_v1 -uroot -pdb-root-password > ./schema_dump.sql

About

My notes about using MySQL with docker

Topics

Resources

Stars

Watchers

Forks

Languages