Plesk

Unable to start MySQL/MariaDB on a Plesk server: Cannot open tablespace table_name which uses space ID

Symptoms

MySQL/MariaDB fails to start with the following error message in the logfile:

[ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_name/db_table uses space ID: 132 at filepath: ./db_name/db_table.ibd.
InnoDB: Error: could not open single-table tablespace file some_table.ibd.

Cause

Client database is corrupted.

Resolution

 

For Plesk on Linux

 

  1. Connect to the server via SSH.

  2. Open the /etc/my.cnf file in a text editor. In this example we use the vi editor:

    • on CentOS/RHEL-based distributions

      # vi /etc/my.cnf

    • on Debian/Ubuntu-based distributions

      # vi /etc/mysql/my.cnf

  3. Add the following line under the [mysqld] section:

    [mysqld]
    innodb_force_recovery = 1

  4. Save the changes and close the file.
  5. Start MySQL/MariaDB service. The command depends on MySQL version and OS:

    # service mariadb start

    # service mysql start

    # service mysqld start

  6. Remove the "innodb_force_recovery = 1" line from the /etc/my.cnf file.

  7. Restart MySQL/MariaDB service. The command depends on MySQL version and OS:

    # service mariadb restart

    # service mysql restart

    # service mysqld restart

    Note: If the steps above did not help, fix the database using the InnoDB force recovery.

 

For Plesk on Windows Server

 

  1. Connect to the server via RDP.

    Open the %plesk_dir%DatabasesMySQLmy.ini file in a text editor.

  2. Add the following line under the [mysqld] section:

    [mysqld]
    innodb_force_recovery = 1

  3. Save the changes and close the file.

  4. Open services.msc and start MySQL/MariaDB service.

  5. Remove "innodb_force_recovery = 1" from %plesk_dir%DatabasesMySQLmy.ini

  6. Restart MySQL/MariaDB service.

  7. Restore the corrupted database from a valid backup.

 

Exit mobile version