备份数据库时,报2013错误:Lost connection to MySQL server”的处理方法
1.Lost connection to MySQL server during query 错误
造成这样的错误原因很多
先试一试在my.ini配置文件中的[client]下增加这两个参数:
bind-address = 127.0.0.1
#skip-name-resolve
这两个参数任意一个就行。
也就是说遇到2006,2013错误就重新连接一下MySQL。
2. MySQL层面,需要配置一些参数,修改所有my.*的配置文件下的[mysqldump]
wait_timeout = x 超时时间
max_allowed_packet = y 最大允许数据量
适当增加x,y的值。
分析:在使用mysqldump的时候(尤其是向NFS上备份的时候),很多人都被’mysqldump:Got error:2013: Lost connection to MySQL server during query when dumping table’的问题困扰,在Manual中对这个问题有一些简单的说明。
在向NFS上备份的时候,数据的流向是这样的:MySQL Server端从数据文件中检索出数据,然后分批将数据返回给mysqldump客户端,然后mysqldump将数据写入到NFS上。一般地,向NFS上写入数据的速度较之Server端检索发送数据的速度要慢得多,这就会导致mysqldump无法及时的接受Server端发送过来的数据,Server端的数据就会积压在内存中等待发送,这个等待不是无限期的,当Server的等待时间超过net_write_timeout(默认是60秒)时它就失去了耐心,mysqldump的连接会被断开,同时抛出错误Got error: 2013: Lost connection。
增加net_write_timeout可以解决上述的问题的。在实践中发现,在增大net_write_timeout后,Server端会消耗更多的内存,有时甚至会导致swap的使用(并不确定是不是修改net_write_timeout所至)。建议在mysqldump之前修改net_write_timeout为一个较大的值(如1800),在mysqldump结束后,在将这个值修改到默认的60。
分享到:
相关推荐
MYSQL server has gone away 引起这个原因是不可怕的.原因是更改了系统的断开时间. mysql>show gloable variables like “%timeout%”; 进行查看 interactive_timeout 的黓认值为28800 wait_timeout 的默认值这:...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决: 1.打开在创建mysql容器时挂载的conf目录下的mysqld.cnf(如下文件) 我创建docker的姿势 2.进入mysqlId.cnf文件中在...
[root@jb51.net]# mysqldump -u dbuser -ppass db > db.sql mysqldump: Got error: 1044: Access denied for user ‘dbuser’@’localhost’ to database ‘db’ when using LOCK TABLES 解决一: 加上-skip-lock-...
ERROR 1130 (HY000): Host ‘localhost’ is not allowed to connect to this MySQL server www.jb51.net 出现原因: mysql只有一个root用户,修改root密码后选了MD5,提交后,重新 登陆出现“Host ‘localhost’ is...
MySQL错误代码以及出错信息对照大全
19/09/20 09:57:47 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException at org.json.JSONObject.(JSONObject.java:144) ## 缺少的东西 at org.apache.sqoop.util.SqoopJsonUtil....
Ruby Quick Syntax Reference.pdf Ruby速查手册,Ruby这语言听起来就很酷! 英文PDF版本,欢迎下载!
发现错误 最近在用Nodejs发送https请求...Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE at SecurePair. (tls.js:1381:32) at SecurePair.emit (events.js:92:17) at SecurePair.maybeInitFinished (tls.js:980:10) at Clear
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1 等问题的解决
连接64位的mysql,即使把mysql安装目录下的libmysql.dll放到qt安装目录bin路径下,也是无法连接数据库。网上给出的做法是下载Qt对应版本的源码,重新编译。这种方法复杂繁琐,且容易编译失败。这里提供了mysql官方给...
B: So the best thing to do is to have a reasonable schedule and avoid getting all your sleep during class time. 2. A: Have you finished your homework? B: Homework? You mean the work assigned ...
NULL 博文链接:https://tgwall163.iteye.com/blog/1491296
The greatest compliment you can give an author of a technical book is “This is the book I wish I had when I got started with this subject.” This is the goal we set for our‐ selves when we started ...
Caused by: MetaException(message:Got exception: org.apache.hadoop.hive.metastore.api.MetaException javax.jdo.JDODataStoreException: Error executing JDOQL query “SELECT “THIS”.”NAME” AS NUCORDER0 ...
Home Assistant 小爱音箱TTS hello_miai天睿tera改版插件-2020 天睿tera修改版 HA hello_miai插件,测试home assistant版本0.105.5
”Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http:///var/run/docker.sock/v1.26/images/json: dial unix /var/run/docker.sock: connect: ...
有时候,连接MySQL的会话经常会异常退出,错误日志里会看到”Got an error reading communication packets”类型的告警。本篇文章我们一起来讨论下该错误可能的原因以及如何来规避。 1.状态变量Aborted_clients和...
38、- I've got your invitation. - Oh, good. ______ A:Can you come? B:Thanks a lot. C:I'll take it. D:May I help you? 39、You haven't been to Beijing, have you? ____________. How I wish to go ...
Anim搜索条形码参数width类型:double必需textController类型:TextEditingController必需onSuffixTap类型:函数su Anim搜索条形码参数width类型:double必需textController类型:TextEditingController必需...
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 342 and 281 in dimension 3 at /pytorch/aten/src/TH/generic/THTensorMoreMath.cpp:1333 2、 RuntimeError: ...