MySQL导入sql脚本错误:2006 - MySQL server has gone away
发布:smiling 来源: PHP粉丝网 添加日期:2014-09-24 21:56:42 浏览: 评论:0
下面我给各位同学介绍在mysql中导入数据库时提示MySQL server has gone away问题的解决方法,如果你碰到mysql提示MySQL server has gone away错误我们可进入参考.
MySQL导入sql脚本错误:2006 - MySQL server has gone away
如一些小脚本很少报错,但最近导入一个10+M的SQL脚本,却重复报错:
Error occured at:2014-03-24 11:42:24
Line no.:85
Error Code: 2006 - MySQL server has gone away
最终找到原因,原来是MySQL导入大批量数据的时候超出了默认允许最大的数据包所以就提示2006 - MySQL server has gone away.
于是找到my.cnf,在[mysqld]加入如下代码:
- max_allowed_packet=300M
- wait_timeout=200000
- interactive_timeout = 200000
意思是最大允许数据包300M,等待超时/活动失效时常200000秒,重启MySQL,代码如下:
- [root@lizhong 20140323]# /etc/init.d/mysqld restart
- Shutting down MySQL.... SUCCESS!
- Starting MySQL. SUCCESS!
- //开源软件:phpfensi.com
再重新导入,一切正常.
Tags: 2006-MySQL server has gone away
相关文章
- ·Navicat中MySQL server has gone away错误怎么办(2014-09-23)
- ·WampServer修改Mysql密码的步骤(2014-09-25)
- ·MySQL server has gone away问题解决办法(2014-10-01)
- ·General error: 2006 MySQL server has gone away(2014-10-02)
- ·sqlserver数据导出到MYSQL数据库方法(2014-10-04)
- ·mysql Starting MySQL..The server quit without updating PID file(2014-10-07)
- ·几种MySQL server has gone away解决办法(2014-10-08)
- ·Can t connect to local MySQL server through socket /tmp/mysql.sock(2014-10-08)
- ·解决MySQL server has gone away几种方法(2014-10-14)
- ·mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/(2014-10-14)
- ·MySQL server has gone away解决办法(2014-10-14)
- ·is not allowed to connect to this MySQL server解决办法(2014-10-14)
- ·MySQL Slave同一server_id的冲突原因分析(2014-10-17)
- ·MySQL server has gone away原因分析与解决办法(2014-10-17)
- ·Can t connect to MySQL server 常见问题解决办法(2014-10-17)
- ·解决#2006 - MySQL server has gone away错误(2015-04-17)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)