温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MySQL错误处理--1146错误

发布时间:2020-07-21 05:39:44 来源:网络 阅读:3657 作者:拎壶冲冲冲 栏目: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”;

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI