mysql 同步线程出现ERROR 2006 (HY000): MySQL server has gone away

今天线上一个备库的同步线程出现ERROR 2006 (HY000): MySQL server has gone away,感觉很奇葩,如下:

mysql> show slave status\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/home/mysql/mysql/tmp/mysql.sock' (2)
ERROR:
Can't connect to the server

果断查看错误日志:

InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
InnoDB: about forcing recovery.
InnoDB: Ending processing because of a corrupt database page.
130602 12:53:40 mysqld_safe Number of processes running now: 0
130602 12:53:40 mysqld_safe mysqld restarted

说明数据页已经损坏了,怎么办?

抱着侥幸的心里加了--innodb_force_recovery=4 参数启动,重启实例,出现如下错误

Error 'Got error -1 from storage engine' on query. Default database: ‘xxx. Query: 'insert into xxxxxx (xx, xx, xxt) values ('efe99421b8038e79843acd0b650afb65', '鏃呮父', '{\"d\":{\"1369977481439\":[{\"n\":\"886101552531604045\",\"c\":\"1543429242 2847814627\"},{\"n\":\"9783085646656052076\",\"c\":\"65157479 2148290874\"},{\"n\":\"8842770608579691284\",\"c\":\"2828403933 962579475\"},{\"n\":\"4532336517264170948\",\"c\":\"2775100323 1262656757\"},{\"n\":\"10283011393799334833\",\"c\":\"832035076 2124070745\"},{\"n\":\"1636910875901144556\",\"c\":\"2441385694 4180750260\"},{\"n\":\"1454801548211122109\",\"c\":\"3872414415 1758090072\"},{\"n\":\"9617252920492977348\",\"c\":\"931080628 4009789701\"},{\"n\":\"10532308482238392940\",\"c\":\"2626421970 2517210497\"},{\"n\":\"3697079241674906690\",\"c\":\"878991478 2838000654\"},{\"n\":\"8877643288045826882\",\"c\":\"3769206655 4119371468\"},{\"n\":\"8720596808003303846\",\"c\":\"91351183 1451699941\"},{\"n\":\"3905702330576

数据物理页损坏,已经无法修复,重做数据,将数问题表据导出,然后倒入数据库;

然后重新同步,问题消失!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值