解决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即可。