概述
今天mysql备份的crontab自动运行的时候,出现了报警,报警内容如下:
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `fsl_rate_log` at row: 763014
下面简单提供下解决思路和方法。
1、修改max_allow_packet数据库参数
正常是max_allow_packet影响了,修改为1G后还是一样
2、查看timeout的值
net_read_timeout :
The number of seconds to wait for more data from a connection before aborting the read. When the server is reading from the client, net_read_timeout is the timeout value controlling when to abort在终止读之前,从一个连接获得数据而等待的时间秒数;当服务正在从客户端读取数据时,net_read_timeout控制何时超时。
net_write_timeout:
The number of seconds to wait for a block to be written to a connection before aborting the write.When the server is writing to the client, net_write_timeout is the timeout value controlling when to abort。在终止写之前,等待多少秒把block写到连接;当服务正在写数据到客户端时,net_write_timeout控制何时超时
3、修改timeout参数
set global net_read_timeout = 1200;
set global net_write_timeout = 9000;
重新测试可正常导出,问题解决
觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~
本文暂时没有评论,来添加一个吧(●'◡'●)