Webhosting Blog

ERROR 1153 (08S01) at line 1868: Got a packet bigger than ‘max_allowed_packet’ bytes


While  import some data into  a  local MySql database I got an error saying

[root@server~]# mysql evince142_tiwi1 < backup.sql
ERROR 1153 (08S01) at line 1868: Got a packet bigger than ‘max_allowed_packet’ bytes

This error is basically received when a MySQL client or the mysqld server receives a packet bigger than max_allowed_packet bytes, it issues a Packet too large error and closes the connection. With some clients, you may also get a Lost connection to MySQL server during query error if the communication packet is too large.

In order to sort the issue you can follow following steps:

1) Login to the sever as root.

2) Open the file /etc/my.cnf.

3) Check if you have an entry related to max_allowed_packet.

4) If it is present you can increase the limit or If it does not you can insert the entry in the file.

In MySQL 3.23, the largest possible packet is 16MB due to limitations in protocol. In MySQL 4.0.1 and up, the limit is 1GB.

[root@server]# vi /etc/my.cnf

max_allowed_packet=16M

5) Save the file and restart the mysql service.

[root@server~]# /etc/init.d/mysql restart

Now while importing the data to the database it should not issue any warning.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s