Plesk

Migration fails: MySQL server has gone away

Symptoms

Cause

Misconfiguration of MySQL/MariaDB server.

Resolution

To restart MySQL/MariaDB server correctly:

  1. Connect to the server via SSH

  2. Stop MySQL/MariaDB server:

    # service mysql stop

  3. Check if there are remained MySQL/MariaDB processes:

    # ps auxffww | grep mysql

    root 2979 0.0 0.0 11768 1584 ? S 22:07 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file= /var/lib/mysql/hostname.pid
    mysql 3083 4.1 1.2 899628 298196 ? Sl 22:07 1:52 _ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mariadb/mariadb.log --pid-file= /var/lib/mysql/hostname.com.pid --socket= /var/lib/mysql/mysql.sock

  4. Kill these processes:

    # kill -9 2979 3083

  5. Remove MySQL/MariaDB pid and socket files:

    # rm -f /var/lib/mysql/hostname.pid /var/lib/mysql/hostname.pid /var/lib/mysql/mysql.sock

  6. Start MySQL/MariaDB server:

    # service mysql start