Articles in this section

Unable to dump database manually or during a backup process on Plesk: Error 2013: Lost connection to server during query when dumping table example at row: 0

Plesk for Linux kb: technical

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

  1. Connect to the server via SSH
  2. Open the file /etc/mysql/mariadb.conf.d/50-server.cnf. Vi editor can be used for this.
  3. Add the parameter max_allowed_packet with a value of 1024M on the [mysqld] sections as follows:

    CONFIG_TEXT: [mysqld]
    max_allowed_packet = 1024M

    Note: If the parameter is already defined, update its value to 1024M or 1G making sure its not commented out with a preceding "#"

  4. Open the file /etc/mysql/conf.d/mysqldump.cnf. Vi editor can be used for this.
  5. Add or update the parameter max_allowed_packet with a value of 1024M on the [mysqldump]:

    CONFIG_TEXT: [mysqldump]
    max_allowed_packet = 1024M

  6. Restart the MySQL/MariaDB service:

    # systemctl restart mariadb || systemctl restart mysql || systemctl restart mysqld

Was this article helpful?

Comments

3 comments
Date Votes
  • 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!

    0
  • I found the max_allowed_packet set to 16M in /etc/mysql/conf.d/mysqldump.cnf. I advise you to check it as well.

     

    1
  • Hello Luis,

    Thank you.

    I've just updated the article based on your comments

    Cheers.

    0

Please sign in to leave a comment.