Applicable to:
- Plesk for Linux
Symptoms
- Plesk Obsidian running on a Debian-based operating system
-
Database dumps initiated by Plesk fail with an error that is similar to the following:
CONFIG_TEXT: error mysqldump: Error 2013: Lost connection to server during query when dumping table example at row: 0
-
The backup generation process from Plesk provides an error as follows:
PLESK_WARN: (Database object 'db_example_exampledb') Unable to make database dump. Error: Failed to exec mysqldump: Exit code: 3: WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol.
- The database on which the database dump actions fail has a large size of 10GB or above and contains very large tables of 512MB or above.
Cause
The default database dumping MySQL limits are reached and the connection between the MySQL client and server is interrupted.
Resolution
- Connect to the server via SSH
- Open the file
/etc/mysql/mariadb.conf.d/50-server.cnf. Vi editor can be used for this. -
Add the parameter
max_allowed_packetwith a value of1024Mon the[mysqld]sections as follows:CONFIG_TEXT: [mysqld]
max_allowed_packet = 1024MNote: If the parameter is already defined, update its value to
1024Mor1Gmaking sure its not commented out with a preceding "#" - Open the file
/etc/mysql/conf.d/mysqldump.cnf. Vi editor can be used for this. -
Add or update the parameter
max_allowed_packetwith a value of1024Mon the[mysqldump]:CONFIG_TEXT: [mysqldump]
max_allowed_packet = 1024M -
Restart the MySQL/MariaDB service:
# systemctl restart mariadb || systemctl restart mysql || systemctl restart mysqld
Comments
Are you sure these changes are supposed to be done on
/etc/mysql/mariadb.conf.d/50-client.cnf? Didn't you mean /etc/my.cnf or /etc/mysql/mariadb.conf.d/50-server.cnf?Thanks!
I found the max_allowed_packet set to 16M in /etc/mysql/conf.d/mysqldump.cnf. I advise you to check it as well.
Hello Luis,
Thank you.
I've just updated the article based on your comments
Cheers.
Please sign in to leave a comment.