Created
July 13, 2019 07:31
-
-
Save kovid-rathee/a36f9f204fc10787a44007706c0ba5e0 to your computer and use it in GitHub Desktop.
Setting up MySQL Replication from Scratch on two instances of MySQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run on Master | |
# Replace slave-ip and master-ip with actual ip addresses of those machines | |
CREATE USER repl; | |
GRANT REPLICATION SLAVE ON *.* TO repl_user@'slave-ip' IDENTIFIED BY 'passwd'; | |
# Run on Slave | |
CHANGE MASTER TO MASTER_HOST = 'master-ip', MASTER_PORT = 3306, MASTER_USER = 'repl', MASTER_PASSWORD = 'passwd'; | |
START SLAVE; | |
# To check the Status of Replication | |
SHOW SLAVE STATUS; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment