master-slave synchronization mysql database, mysql must be the same as the version on the master and slave, and if not the same as what results?

Slave_SQL_Running: No mysql sync troubleshooting
If data is not synchronized can try the data
MySQL> Show slave Status \ G
Slave_IO_Running: Yes
Slave_SQL_Running: No
Last_Errno: 1062
....
Seconds_Behind_Master: NULL
reasons:
1. The program may have been written on the slave operation
2 may also be a slave after re-starting the machine, due to transaction rollback.
solution the I:
1. first of all service stopped Slave: slave stop
view on to the main server host 2. status:
record File Position and the corresponding value.
MySQL> Show Master Status;
+ ----------- + ----------------------- + ------------------ - + ------------------ +
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+ ------------------ ----------- + -------------- + ------------------ + +
| mysql- bin.000020 | 135617781 | | |
+ ------------------ + ----------- + -------------- + --- + ---------------
. 1 in Row SET (0.00 sec)
3. the slave server to perform a manual synchronization:
MySQL> Change to Master
> MASTER_HOST = 'master_ip',
> = MASTER_USER ' User ',
> = master_password' pwd ',
> 3307 MASTER_PORT =,
> = MASTER_LOG_FILE' MySQL-bin.000020 ',
> = 135 617 781 MASTER_LOG_POS;
. 1 in Row SET (0.00 sec)
MySQL> Slave Start;
. 1 in Row SET (0.00 sec)
again to view the status of slave found:
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
...
Seconds_Behind_Master: 0
solution II:
MySQL> slave STOP;
MySQL> the SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
MySQL> slave Start;

Guess you like

Origin www.cnblogs.com/sqlservertongbu/p/11013456.html