SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; SET GLOBAL sql_mode = 'modes'; SET SESSION sql_mode = 'modes'; SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;
Tag: mysql
Error Code: 2006 – MySQL server has gone away when importing backup
The problem is probably caused by too large backup/restore script or SQL commands. The solution which works for me is increasing `max_allowed_packet` setting in my.ini
- Open “c:\ProgramData\MySQL\MySQL Server 5.6\my.ini”
- Change max_allowed_packet to 24M
- Save and restart mysql service
External sources:
ERROR 2006 (HY000) at line 1: MySQL server has gone away
Problem:
Getting error 2006 during database backup import. The problem is in short timeout and small packet size. It’s necessary to update my.cnf and restart MySql service.
Solution:
[mysqld] max_allowed_packet = 64M wait_timeout = 6000 [mysqldump] max_allowed_packet = 64M