记一次mysql生产数据库备份报错:dumping table `xx` at row: xx

概述

今天mysql备份的crontab自动运行的时候,出现了报警,报警内容如下:

<code> mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `fsl_rate_log` at row: 763014/<code>
记一次mysql生产数据库备份报错:dumping table `xx` at row: xx

下面简单提供下解决思路和方法。


1、修改max_allow_packet数据库参数

正常是max_allow_packet影响了,修改为1G后还是一样

记一次mysql生产数据库备份报错:dumping table `xx` at row: xx


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控制何时超时

记一次mysql生产数据库备份报错:dumping table `xx` at row: xx



3、修改timeout参数

<code>set global net_read_timeout = 1200;
set global net_write_timeout = 9000;/<code>
记一次mysql生产数据库备份报错:dumping table `xx` at row: xx

重新测试可正常导出,问题解决


觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~


记一次mysql生产数据库备份报错:dumping table `xx` at row: xx


分享到:


相關文章: