Articles in this section

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

Plesk for Windows Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

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

  • on Linux: /var/log/mariadb/mariadb.log or /var/log/mysql/error.log
  • on Windows Server: %plesk_dir%DatabasesMySQL\data\SERVERNAME.err

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

    CONFIG_TEXT: [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%Databases\MySQL\my.ini file in a text editor.

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

    CONFIG_TEXT: [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%Databases\MySQL\my.ini

  6. Restart MySQL/MariaDB service.

  7. Restore the corrupted database from a valid backup.

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.