Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
Plesk interface is not accessible with one of the errors:
CONFIG_TEXT: ERROR: Zend_Db_Statement_Exception
SQLSTATE[HY000]: General error: 1030 Got error -1 from storage engineOR
CONFIG_TEXT: Error: Failed to connect to MySQL: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
OR
CONFIG_TEXT: Server Error
500
Plesk\Exception\Database
DB query failed: SQLSTATE[HY000]: General error: 1881 Operation not allowed when innodb_forced_recovery > 0., query was: INSERT INTO sessions (sess_id, type, login, ip_address, login_time, modified, lifetime) VALUES (?, ?, ?, ?, ?, ?, ?)OR
CONFIG_TEXT: Server Error
500
Plesk\Exception\Database
DB query failed: SQLSTATE[HY000]: General error: 1036 Table 'sessions' is read only, query was: INSERT INTO `sessions` (`sess_id`, `type`, `login`, `ip_address`, `login_time`, `modified`, `lifetime`) VALUES (?, ?, ?, ?, ?, ?, ?) -
In the MySQL configuration file (
/etc/my.cnf
or/etc/mysql/my.cnf
on Plesk for Linux,%plesk_dir%MySQL\my.ini
on Plesk for Windows), the parameterinnodb_force_recovery
is set to the value more than 0:# grep innodb_force_recovery /etc/my.cnf
innodb_force_recovery=4 -
Restoration of the database from Plesk backup fails:
PLESK_ERROR: Stderr is ERROR 1881 (HY000) at line 48 in file: 'C:\Program Files (x86)\Parallels\Plesk\PrivateTemp\pmm-ru-udb-dump-01d4f884b411e470\pmm-mysdp-dd-dump-e7566891d2ba42a4a9306c12c48e53dc': Operation not allowed when innodb_forced_recovery > 0.
-
WordPress login page redirects to https://example.com/wp-login.php?redirect_to=https%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1 after enteting login and password.
With WordPress debug enabled, the following message is logged:CONFIG_TEXT: [Operation not allowed when innodb_forced_recovery > 0.]
Cause
The option innodb_force_recovery
is enabled and prevents MySQL from functioning properly.
Resolution
Note: This article is intended for use by server administrators. In case there is no administrative SSH or RDP access to the server, contact the server administrator or server provider.
-
Disable the option
innodb_force_recovery
in the MySQL configuration:-
Plesk for Linux
-
Open the file
/etc/my.cnf
(/etc/mysql/my.cnf
on Debian and Ubuntu) for editing. -
Remove the line which contains the option
innodb_force_recovery
and save the file. -
Restart MySQL service to apply the change (depending on the operating system, service can be called
mysql
ormariadb
):# service mysqld restart
-
-
Plesk for Windows
- Open the file
%plesk_dir%MySQL\my.ini
in any text editor. -
Remove the line which contains the option
innodb_force_recovery
and save the file. -
Open the Services snap-in:
- in Windows Server 2008 and 2008 R2: go to Start > Administrative Tools > Services.
- in Windows Server 2012 and newer: go to Start > Server Manager > Tools > Services.
-
Select Plesk SQL Server and click Restart.
- Open the file
-
Note: If after removing the line with the option innodb_force_recovery
MySQL service still fails to start, it is required to fix InnoDB corruption.
Depending on used operating system, follow one of the articles below for doing that:
How to fix InnoDB corruption cases for the MySQL databases on Plesk for Linux?
How to fix InnoDB corruption cases for the MySQL databases on Plesk for Windows?
Comments
0 comments
Please sign in to leave a comment.