Solve the Problem of MySQL Slave Synchronization
Solution:
1. stop the Slave service first: slave stop;
2. Check the host status on the master server:
Record the value corresponding to File and Position.
Mysql> show master status;
+ ------------------ + ----------- + -------------- + ------------------ +
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+ ------------------ + ----------- + -------------- + ------------------ +
| Mysql-bin.000020 | 135617781 |
+ ------------------ + ----------- + -------------- + ------------------ +
1 row in set (0.00 sec)
3. Execute manual synchronization on the slave server:
Mysql> change master
> Master_host = 'master _ ip ',
> Master_user = 'user ',
> Master_password = 'pwd ',
> Master_port = 3307,
> Master_log_file = 'mysql-bin.20.20 ',
> Master_log_pos = 135617781;
4. Start slave
Slave start;
5. view the slave status
Show slave status \ G;
This article permanently updates the link address: