Guest User

Untitled

a guest
Jun 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. On master.
  2. ==========
  3. Add user:
  4. CREATE USER 'slave1'@'';
  5. GRANT REPLICATION SLAVE ON *.* TO 'slave1'@'' IDENTIFIED BY ''; <== use mkpasswd here
  6.  
  7. Smart dump databases:
  8. mysqldump --skip-lock-tables --single-transaction --routines --flush-logs --hex-blob --master-data=2 -B database1 database2 databaseN > ~/dump.sql
  9.  
  10. On slave.
  11. =========
  12. Restore dump.sql on slave:
  13. mysql < dump.sql
  14.  
  15. Get master log and position:
  16. head dump.sql -n80 | grep "MASTER_LOG_POS"
  17.  
  18. Set master and start:
  19. CHANGE MASTER TO MASTER_HOST='',MASTER_USER='',MASTER_PASSWORD='', MASTER_LOG_FILE='', MASTER_LOG_POS=;
  20. START SLAVE;
  21.  
  22. SHOW SLAVE STATUS;
  23.  
  24. Done.
Add Comment
Please, Sign In to add comment