原文地址:http://hi.baidu.com/chinalwb/blog/item/8b83ce14cfa3954121a4e96c.html
刚才在导入数据库的时候 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
搜了下,说是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.
==================================================================
类似于oracle中数据缓冲区的概念,数据量过大数据导入失败。