最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

MySQL错误处理

互联网 admin 3浏览 0评论

MySQL错误处理

在MySQL的主从复制过程中,出现了1146错误。提示的错误原因是:在默认的数据中找不到指定的表。
show slave status\G;现实的同步状态。
Slave_IO_Running: YES
Slave_SQL_Running: No
Last_Errno: 1146
Last_Error: Error 'Table 'coop.Coop_Data' doesn't exist' on query. Default database: 'gcore'. Query: 'update coop.Coop_Data set State='2',NameLevel='2',CheckedTime=now(),Memo='' where DAID='18601''
Skip_Counter: 0
Last_SQL_Errno: 1146
Last_SQL_Error: Error 'Table 'coop.Coop_Data' doesn't exist' on query. Default database: 'gcore'. Query: 'update coop.Coop_Data set State='2',NameLevel='2',CheckedTime=now(),Memo='' where DAID='18601''

原因是
先使用的use db_name1,然后执行了 update db_name2.table set这种sql语句。

解决方法:
在从服务器上设置忽略该错,在my.cnf文件中添加“slave-skip-errors = 1146”,
如果少量的这种错误,直接在mysql client里面设置“set global sql_slave_skip_counter=1”;

MySQL错误处理

在MySQL的主从复制过程中,出现了1146错误。提示的错误原因是:在默认的数据中找不到指定的表。
show slave status\G;现实的同步状态。
Slave_IO_Running: YES
Slave_SQL_Running: No
Last_Errno: 1146
Last_Error: Error 'Table 'coop.Coop_Data' doesn't exist' on query. Default database: 'gcore'. Query: 'update coop.Coop_Data set State='2',NameLevel='2',CheckedTime=now(),Memo='' where DAID='18601''
Skip_Counter: 0
Last_SQL_Errno: 1146
Last_SQL_Error: Error 'Table 'coop.Coop_Data' doesn't exist' on query. Default database: 'gcore'. Query: 'update coop.Coop_Data set State='2',NameLevel='2',CheckedTime=now(),Memo='' where DAID='18601''

原因是
先使用的use db_name1,然后执行了 update db_name2.table set这种sql语句。

解决方法:
在从服务器上设置忽略该错,在my.cnf文件中添加“slave-skip-errors = 1146”,
如果少量的这种错误,直接在mysql client里面设置“set global sql_slave_skip_counter=1”;

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论