Articles in this section

Plesk is not accessible and MariaDB service cannot start: InnoDB: Error: space header page consists of zero bytes in data file ./ibdata1

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Plesk is not accessible:

    CONFIG_TEXT: 500 Plesk\Exception\Database
    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):

    CONFIG_TEXT: 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

  1. Connect to the server via SSH.

  2. 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/

  3. 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*

  4. Start mariadb service:

    # systemctl start mariadb

  5. 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

  6. Restore user's databases from its dumps using backup manager.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.