主库:mysql-111
从库:mysql-112
主库由3306端口修改成3307后,
从库执行如下命令
mysql> stop slave;
mysql> change master to master_port=3307;
mysql> CHANGE MASTER TO MASTER_HOST='192.168.10.111',MASTER_USER='beifen',MASTER_PASSWORD='LXYlxy2:024.#8u}',MASTER_LOG_FILE='atguigu-bin.000245',MASTER_LOG_POS=191;
mysql> start slave;
mysql> show slave status\G;
参考 优秀文档