mysqldump Lost connection to MySQL server during query when dumping table

When taking backup of a MySQL database, i got error

This error happens when connection between your MySQL client and server is timing out during the mysqldump process.

To fix, increase the value of max_allowed_packet in both MySQL server and client configuration files. This parameter controls the maximum size of a single packet. The default value is 16M, but you can increase it up to 1G.

On Ubuntu MariaDB installation, edit MySQL client configuration file

Under [client], add

set max_allowed_packet for mysql client

Next you need to update MySQL server configuration file

Under [mysqld] section, find entry for max_allowed_packet, update its value to 1G, if not found, add an entry.

configure mariadb server max_allowed_packet

Now restart MySQL

Back to mysqldump

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *