Home >Database >Mysql Tutorial >How to Fix MySQL Error 1153: Maximum Packet Size Exceeded?
MySQL Error 1153: Maximum Packet Size Exceeded
When you encounter MySQL error 1153 while importing a dump, it indicates that the packet size of the imported data exceeds the maximum allowed packet size for your MySQL instance.
Determining the Correct Settings
To resolve this issue, you need to increase the maximum allowed packet size. This setting exists both for the MySQL client and server.
Client-Side Setting
Modify the client command to specify the increased packet size:
mysql --max_allowed_packet=100M -u root -p database < dump.sql
Server-Side Setting
Edit the MySQL configuration file (my.cnf or my.ini) and locate the [mysqld] section. Adjust the following setting:
max_allowed_packet=100M
Alternatively, you can adjust these settings within a MySQL console connected to the server:
set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;
Additional Precautions
The above is the detailed content of How to Fix MySQL Error 1153: Maximum Packet Size Exceeded?. For more information, please follow other related articles on the PHP Chinese website!