If you come across this error while, for example, restoring a database from an sql file from the command line, remember that both the MySQL client and server have their own max_allowed_packet variables. Changing the client's max_allowed_packet variable on the command line may not help you with clearing the error.
To change the server side max_allowed_packet variable you can edit the my.cnf file (located at /etc/my.cnf on CentOS). The default value of max_allowed_packet is 1MB. To set it to 16MB make sure that there is the following line in the configurations file in the [mysqld] section:
max_allowed_packet=16MAfter restarting te server,
/etc/init.d/mysqld restartand logging into mysql you can check the curent value by running the following:
show variables like 'max_allowed_packet';
Comments
Good, for posting this type
Good, for posting this type of blog!!
Post new comment