Symptoms
-
Migration fails with the following error:
MySQL server has gone away
-
There was an upgrade from MariaDB 5.5 to MariaDB 10.0 on the destination server
-
Restarting MySQL/MariaDB server on the destination server switches MySQL/MariaDB server to safe mode:
# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL SUCCESS!
[root@server]# 171103 21:31:13 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
171103 21:31:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql -
There are the following errors in
/var/log/mariadb/mariadb.log
:171103 21:34:04 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
171103 21:34:35 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
171103 21:34:35 [ERROR] Plugin 'Aria' init function returned error.
171103 21:34:35 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Cause
Misconfiguration of MySQL/MariaDB server.
Resolution
To restart MySQL/MariaDB server correctly:
-
Connect to the server via SSH
-
Stop MySQL/MariaDB server:
# service mysql stop
-
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 -
Kill these processes:
# kill -9 2979 3083
-
Remove MySQL/MariaDB pid and socket files:
# rm -f /var/lib/mysql/hostname.pid /var/lib/mysql/hostname.pid /var/lib/mysql/mysql.sock
-
Start MySQL/MariaDB server:
# service mysql start