Skip to content

Latest commit

 

History

History

mysql-master-slave

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

MySQL Master Slave Using Docker

How to use

git clone https://github.com/danielcristho/docker-stuff.git && cd docker-stuff
cd single-node/mysql-master-slave

Create new environment file.

cp .env.example .env

Change the values as you want. Example:

MYSQL_DATABASE=docker_db
MYSQL_USER=docker_user
MYSQL_PASSWORD=docker_pass
MYSQL_ALLOW_EMPTY_PASSWORD=1

Run the .sh file.

bash run.sh

or

./run.sh

Make sure the containers is up. Then accessing the master and slave.

docker exec -it mysql_master mysql -u docker_user -pdocker_pass
docker exec -it mysql_slave mysql -u docker_user -pdocker_pass

Try to create new table, create new database or others modification to make sure the replication is running.