久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

MySQL5.7中mysqldump:查詢Error 2013備份報錯怎么辦

146次閱讀
沒有評論

共計 2298 個字符,預計需要花費 6 分鐘才能閱讀完成。

丸趣 TV 小編給大家分享一下 MySQL5.7 中 mysqldump: 查詢 Error 2013 備份報錯怎么辦,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

描述

生產環境使用 MySQL5.7.19 之前每天正常的備份突然報錯,后臺日志報錯信息如下:

2018-11-01T20:33:05.754602Z 57223 [Note] Aborted connection 57223 to db: *** user: root host: localhost (Got timeout writing communication packets)

2018-11-02T20:32:02.062349Z 57512 [Note] Aborted connection 57512 to db: *** user: root host: localhost (Got timeout writing communication packets)

2018-11-03T17:02:17.276883Z 57759 [Note] Aborted connection 57759 to db: *** user: root host: localhost (Got timeout writing communication packets)

2018-11-03T20:33:42.574751Z 57802 [Note] Aborted connection 57802 to db: *** user: root host: localhost (Got timeout writing communication packets)

2018-11-04T08:57:33.911527Z 57952 [Warning] IP address ***.****.***.*** could not be resolved: Name or service not known

2018-11-04T20:32:41.571757Z 58092 [Note] Aborted connection 58092 to db: *** user: root host: localhost (Got timeout writing communication packets)

2018-11-05T00:52:24.345151Z 58144 [Note] Aborted connection 58144 to db: *** user: root host: localhost (Got timeout writing communication packets)

解決思路

  一開始認為是包最大值太小,即調大 max_allowed_packet 參數,將參數調大到 200M 之后再進行備份發現備份依然報錯查看報錯信息:

mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `***` at row: 325118 與后臺日志信息:

2018-11-05T01:12:30.211358Z 58154 [Note] Aborted connection 58154 to db: *** user: root host: localhost (Got timeout writing communication packets)

查看 timeout 參數信息:

mysql  show global variables like  %timeout% 
+-------------------------------+----------+
| Variable_name | Value 
+-------------------------------+----------+
| connect_timeout | 10 |
| delayed_insert_timeout | 300 |
| have_statement_timeout | YES |
| innodb_flush_log_at_timeout | 1 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| lock_wait_timeout | 31536000|
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| rpl_stop_slave_timeout | 31536000|
| slave_net_timeout | 60 |
| wait_timeout | 28800 |
+-------------------------------+----------+
13 rows in set (0.00 sec)
 查閱官方文檔發現這兩個參數值太小導致 mysqldump 報錯
| net_read_timeout | 30 |
| net_write_timeout | 60 |

調大這兩個參數:

mysql  set global net_read_timeout = 120;
Query OK, 0 rows affected (0.00 sec)
mysql  set global net_write_timeout = 900;
Query OK, 0 rows affected (0.00 sec)

再執行備份腳本,報錯信息消失,備份正常!

看完了這篇文章,相信你對“MySQL5.7 中 mysqldump: 查詢 Error 2013 備份報錯怎么辦”有了一定的了解,如果想了解更多相關知識,歡迎關注丸趣 TV 行業資訊頻道,感謝各位的閱讀!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-07-26發表,共計2298字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 突泉县| 德州市| 厦门市| 襄汾县| 来宾市| 名山县| 赤壁市| 资源县| 黄石市| 抚州市| 嫩江县| 泾川县| 诏安县| 杭州市| 西昌市| 芮城县| 天等县| 永昌县| 瓦房店市| 昭平县| 英德市| 和田市| 大安市| 西峡县| 斗六市| 宁晋县| 莱西市| 太和县| 舟山市| 赤壁市| 德昌县| 洱源县| 肃北| 大宁县| 鄯善县| 富蕴县| 什邡市| 湟源县| 隆安县| 中阳县| 潮州市|