To view the status from the library:
Mysql>show slave statusg;
Where Slave_io_running:yes indicates whether the synchronization IO is running, Slave_sql_running:yes indicates whether the synchronization SQL is running, and Last_error indicates the content of the last error.
I ran into an error SQL today with the following contents:
Last_error:error ' Duplicate entry ' 14772680-15′for key ' PRIMARY ' on query. Default database: ' xxxxxxxx '. Query: ' UPDATE pre_forum_post SET position=position+ ' 14′where ' tid ' in (' 14772680′, ' 14773058′ ')
This statement caused an error from the library and slave SQL stopped.
Execute Mysql>set GLOBAL sql_slave_skip_counter=2; Skipping a conflicting record.
and then restart Slave.
Mysql>stop slave
Mysql>start slave
If you encounter Slave_io_running:no, the instructions are master-slave IO does not run up. Today, I found another long unused db in this case, he restarted. Www,111cn.net
The error message is:
[ERROR] Got fatal error 1236: ' Could not find the ' the ' the ' in ' binary Log index file '
From master when reading the data from binary log
View the status of the main library on the main library
Mysql>show Master status;
List A record, very simple information
+ —————— + ——— –+ ———— –+ —————— +
| File | Position | binlog_do_db | binlog_ignore_db |
+ —————— + ——— –+ ———— –+ —————— +
| mysql-bin.002323 | 121077462 | | |
+ —————— + ——— –+ ———— –+ —————— +
Then execute from the library:
Mysql>stop slave;
Mysql>change Master to master_log_file= ' mysql-bin.002323′,master_log_pos=121077462;
Mysql>start slave;
View the status from the library again
Mysql>show slave statusg;
Found normal.
Another encounter today is a strange phenomenon, that is, MySQL stopped after the start up. Error
Starting MySQL. error! Manager of Pid-file quit without updating file.
#/usr/bin/mysql_safe
Then it's normal, stop safe mode and start again.
#service MySQL Start