If we are dumping big db’s we can see this error usually , because the default value of max_allowed_packet is 25M.
Solution :-
Two ways you can fix this
1) Add the following in your /etc/my.cnf and restart mysql
[mysqldump]
max_allowed_packet = 500M
2) Use mysqldump with the option –max_allowed_packet
mysqldump -u root -p --max_allowed_packet=512M -B databaseName -- tables tablename > dbname.sql
Recent Comments