刚才在导入数据库的时候 SQLyog 报错了
Error Code: 2006 - MySQL server has gone away
搜了下,说是max_allowed_packet (MySQL的一个参数)设置的值不够大。
那我改下就行了 嘿嘿
In Windows:
In the MySQL server installation directory,
in my.ini file, add the following line under [mysqld] in SERVER SECTION.
max_allowed_packet = 16M
In 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
Save the file and restart MySQL server.
转Error Code: 2006 - MySQL server has gone away(Error Code: 2006 - MySQL 服务器已离线)
最新推荐文章于 2020-10-22 20:27:52 发布
本文详细介绍了如何解决SQLyog导入数据库时报错ErrorCode:2006-MySQLserverhasgoneaway的问题,主要是由于max_allowed_packet参数设置过小导致。提供了在Windows和Linux环境下修改my.ini和my.cnf文件的具体步骤,帮助用户解决该问题。
931

被折叠的 条评论
为什么被折叠?



