Reason:
When we use to import bigger size MySQL files then we get such an error.
Possible Solutions:
Please open your mysql terminal and type mysql to get a mysql prompt. In your mysql settings look for the following files.
- my.cnf
- my.ini
max_allowed_packet=100M
max_allowed_packet=1000M ; 1GB
After updating the above file in localhost or live server. Please restart the mysql/apache servers. So
that change will reflect. To restart the mysql server please run the following command.
service mysql restart
set global max_allowed_packet=1000000000;
set global net_buffer_length=1000000;
Note:
The default MySQL 5.6. 6 max packet size is 4MB
Also, you can dump the MySQL file using the below command by mentioning the size
set global net_buffer_length=1000000;
The above commands basically, increase and set the max allowed packet size in mysql.
Note:
The default MySQL 5.6. 6 max packet size is 4MB
Also, you can dump the MySQL file using the below command by mentioning the size
mysql --max_allowed_packet=100M -u root -p database < dump.sql
No comments:
Post a Comment