iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >MySQL5.7中mysqldump:查询Error 2013备份报错怎么办
  • 223
分享到

MySQL5.7中mysqldump:查询Error 2013备份报错怎么办

2024-04-02 19:04:59 223人浏览 八月长安
摘要

小编给大家分享一下Mysql5.7中mysqldump:查询Error 2013备份报错怎么办,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!描述生产环境使用Mysql5.7.19之前每天正

小编给大家分享一下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备份报错怎么办”有了一定的了解,如果想了解更多相关知识,欢迎关注编程网数据库频道,感谢各位的阅读!

您可能感兴趣的文档:

--结束END--

本文标题: MySQL5.7中mysqldump:查询Error 2013备份报错怎么办

本文链接: https://www.lsjlt.com/news/63344.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • MySQL5.7中mysqldump:查询Error 2013备份报错怎么办
    小编给大家分享一下MySQL5.7中mysqldump:查询Error 2013备份报错怎么办,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!描述生产环境使用MySQL5.7.19之前每天正...
    99+
    2022-10-18
  • mysqldump执行备份数据时出现报错怎么办
    下面一起来了解下mysqldump执行备份数据时出现报错怎么办,相信大家看完肯定会受益匪浅,文字在精不在多,希望mysqldump执行备份数据时出现报错怎么办这篇短内容是你想要的。环境;MySQL 版本 5...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作