教程集 www.jiaochengji.com
教程集 >  数据库  >  mysql  >  正文 mysql 导入数据报2006错误的解决方法

mysql 导入数据报2006错误的解决方法

发布时间:2015-11-16   编辑:jiaochengji.com
在mysql中导入数据库时,SQLyog 报错:Error Code: 2006 - MySQL server has gone away,网上说是max_allowed_packet(MySQL的一个参数)设置的值不够大。为大家提供解决方法,供参考。

解决mysql导入数据报2006错误的问题。

1、windows环境
In the MySQL server installation directory,
in my.ini file, add the following line under [mysqld] in SERVER SECTION.
max_allowed_packet = 16M

2、linux环境
Copy the my-xxx.cnf file from /usr/share/mysql to /etc as my.cnf
xxx can be small, medium, large, huge ... depending on the requirement.
$ cp /usr/share/mysql/my-xxx.cnf /etc/my.cnf

In the my.cnf file, change the default
max_allowed_packet = 1M
to
max_allowed_packet = 16M

保存,并重启mysql即可。

您可能感兴趣的文章:
mysql 导入数据报2006错误的解决方法
mysql提示MySQL server has gone away导入时报错2006错误
mysql 6G数据库的导入报错的解决办法
MySQL导入数据库时报错,MySQL server has go away
mysql启动错误报1067错误怎么解决
mysql报General error 2006 MySQL server has gone away...错误解决方法
phpmyadmin导入大数据库文件时问题的解决方法
mysql无法启动出现1067错误问题(图文)
解决ERROR 2006 (HY000) at line XX: MySQL server has gone away问题
解决Lost connection to MySQL server during query错误方法

关键词: mysql gone away   
[关闭]
~ ~