Home arrow Blog

Restarting MySQL replication after an error

It is easy for replication to be upset slightly, resulting in an error on the slave that stops it operating. It then gets behind the master and manual intervention is needed.

Sometimes more substantial intervention is needed, but often bypassing the error is all that is needed. Before you start, check the situation by going into a MySQL client and entering:

 show slave status\G

Look at the error to see whether it is the sort of thing that can reasonably be ignored on a slave. If so, in a MySQL client enter the following statements:

 stop slave;
 set global sql_slave_skip_counter = 1;
 start slave;
 show slave status\G

Check whether the slave is now running. Sometimes this has to be repeated - checking each time that the error can be ignored. Often this will get replication working again and the slave will catch up with the master.

#128004 • 05/18/2012 12:19pm by • Vote: Up votes (104) Down votes (79)

Configuring MySQL for UTF-8

If you want to run MySQL primarily using UTF-8 then the configuration file my.cnf should contain the following directives:

#128003 • 02/27/2011 5:11pm by Martin Brampton • Vote: Up votes (108) Down votes (90)

Checking for problems in my.cnf

If you want to check for errors in the MySQL configuration file my.conf you can start the MySQL daemon from a command line with helpful parameters:

mysqld --help

will provide a lot of information about the available parameters.

#128002 • 02/27/2011 5:07pm by Martin Brampton • Vote: Up votes (109) Down votes (78)

How to change collation for all columns in a MySQL table

In principle, it is possible to change the character set for all the fields in a table. But this can give problems and needs to be tackled with care. The table should certainly be backed up before attempting the change.

#128001 • 02/27/2011 5:01pm by Martin Brampton • Vote: Up votes (112) Down votes (72)

Results 1 to 4 of 4