Friday, February 01, 2008

MySQL 同步1064错误及补救方法

Last_Error: Error 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` = 37938' at line 1' on query. Default database: 'search_production'. Query: 'UPDATE tests SET `created_at` = 1195728959, `published_at` = 11d` = 37938'

slaver服务器上收到这个奇怪的1064错误,从master server传过来的要执行的语句应该是:
UPDATE tests SET `created_at` = 1195728959, `published_at` = 1195728081 where `id` = 37938
却变成了上面的样子,在确认此条语句重要性不大后在从服务器上执行以下语句跳过此错误继续同步数据。
mysql> SET GLOBAL SQL_slave_SKIP_COUNTER = n;
mysql> START SLAVE;
按mysql5.1手册上说,在从服务器上没有过直接的数据操作不应该出现这类错误。

No comments :