Applicable to:
- Plesk for Linux
Symptoms
-
Plesk is not accessible:
500 PleskExceptionDatabase
DB query failed: SQLSTATE[HY000] [2002] Connection refused
0: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:144 -
MariaDB service cannot start with the following error in
/var/log/mariadb/mariadb.log
(or/var/log/mysqld.log
):InnoDB: Error: space header page consists of zero bytes in data file ./ibdata1
Cause
File /var/lib/mysql/ibdata1
is corrupted.
Resolution
File ibdata1
is the system tablespace for the InnoDB infrastructure. It contains several classes for information vital for InnoDB.
When the file is corrupted, the only possible solution is to restore data from backups.
Note: if you don't have root access to Plesk server via SSH, contact your hosting provider regarding the issue
-
Connect to the server via SSH.
-
Back up the
/var/lib/mysql/
directory:2.1. Create a new directory for storing backup:
# mkdir /root/mysql_backup
2.2. Backup data from the
/var/lib/mysql/
to the newly created directory:# cp -a /var/lib/mysql/* /root/mysql_backup/
-
Remove
/var/lib/mysql/ibdata1
, and/var/lib/mysql/ib_logfile*
files by executing commands below:# rm /var/lib/mysql/ibdata1
# rm /var/lib/mysql/ib_logfile*
-
Start mariadb service:
# systemctl start mariadb
-
Restore Plesk related databases from a daily dump:
5.1. Switch to the directory with daily dumps:
# cd /var/lib/psa/dumps
5.2. Execute the command below to restore all system databases from the latest available daily dump
mysql.daily.dump.0.gz
:# zcat mysql.daily.dump.0.gz | plesk db
-
Restore user's databases from its dumps using backup manager.