概述
今天mysql備份的crontab自動運行的時候,出現了報警,報警內容如下:
<code> mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `fsl_rate_log` at row: 763014/<code>
下面簡單提供下解決思路和方法。
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參數
<code>set global net_read_timeout = 1200;
set global net_write_timeout = 9000;/<code>
重新測試可正常導出,問題解決
覺得有用的朋友多幫忙轉發哦!後面會分享更多devops和DBA方面的內容,感興趣的朋友可以關注下~
閱讀更多 波波說運維 的文章