Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On master.
- ==========
- Add user:
- CREATE USER 'slave1'@'';
- GRANT REPLICATION SLAVE ON *.* TO 'slave1'@'' IDENTIFIED BY ''; <== use mkpasswd here
- Smart dump databases:
- mysqldump --skip-lock-tables --single-transaction --routines --flush-logs --hex-blob --master-data=2 -B database1 database2 databaseN > ~/dump.sql
- On slave.
- =========
- Restore dump.sql on slave:
- mysql < dump.sql
- Get master log and position:
- head dump.sql -n80 | grep "MASTER_LOG_POS"
- Set master and start:
- CHANGE MASTER TO MASTER_HOST='',MASTER_USER='',MASTER_PASSWORD='', MASTER_LOG_FILE='', MASTER_LOG_POS=;
- START SLAVE;
- SHOW SLAVE STATUS;
- Done.
Add Comment
Please, Sign In to add comment