在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”;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。