- 搭建复制的必备条件:复制的机器之间网络通畅,Master打开了binlog。
- 搭建复制步骤:
- 1. 创建复制账户:GRANT REPLICATION SLAVE ON *.* TO ‘repl’@’%’ IDENTIFIED BY‘xxx’;
- 2. SHOW MASTER STATUS;记录下File和Postion。
- 3. 在Slave上CHANGE MASTER TO master_host=‘IP‘, master_user=’repl’, master_password=‘xxx’, master_log_file=’mysql-bin.00000x’, master_log_pos=pos;
- 4. Slave上执行Slave start开始复制。
评论列表
文章目录