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%Databases
MySQL\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
-
Connect to the server via SSH.
-
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
-
-
Add the following line under the [mysqld] section:
CONFIG_TEXT: [mysqld]
innodb_force_recovery = 1 - Save the changes and close the file.
-
Start MySQL/MariaDB service. The command depends on MySQL version and OS:
# service mariadb start
# service mysql start
# service mysqld start -
Remove the "innodb_force_recovery = 1" line from the
/etc/my.cnf
file. -
Restart MySQL/MariaDB service. The command depends on MySQL version and OS:
# service mariadb restart
Note: If the steps above did not help, fix the database using the InnoDB force recovery.
# service mysql restart
# service mysqld restart
-
Connect to the server via RDP.
Open the
%plesk_dir%Databases\MySQL\my.ini
file in a text editor. -
Add the following line under the [mysqld] section:
CONFIG_TEXT: [mysqld]
innodb_force_recovery = 1 -
Save the changes and close the file.
-
Open services.msc and start MySQL/MariaDB service.
-
Remove "innodb_force_recovery = 1" from
%plesk_dir%Databases\MySQL\my.ini
-
Restart MySQL/MariaDB service.
- Restore the corrupted database from a valid backup.
Comments
0 comments
Please sign in to leave a comment.