I’m trying to execute a simple insert query to mysql database, but it gives me this error:
Operation not allowed when innodb_forced_recovery > 0.
I’m trying to set the innodb_force_recovery to zero, but it give me the same error. I tried to add the following line to the my.ini file under [mysqld]:
innodb_force_recovery=0
But it doesn’t work. I also tried to set it from command line:
--innodb_force_recovery=0;
But again it didn’t work. Anyone knows how to solve this?
it must be set somewhere. grep -r innodb_force_recovery /etc/my.cnf /etc/mysql/* – akuzminskyMar 14, 2014 at 14:47
check if you have /usr/my.cnf – akuzminskyMar 14, 2014 at 14:48
I set it to 0, but now mysql does not start. This is the log error: pastebin.com/GxGCgVFg – BlackechoMar 14, 2014 at 14:55
Don’t expect that innodb_force_recovery > 0 will fix your InnoDB tablespace. This option is intended to ignore some errors so you are able to take a dump of your data – akuzminskyMar 14, 2014 at 15:15
This issue occurs when MySQL is in read-only mode.
Edit file /etc/my.cnf
, and comment out the following line
# innodb_force_recovery = 1
If you don’t have access to the file, ask your administrator to fix it. When this line is commented out or does not exist, it reverts to a default setting of 0
.
Step 1: Open my.cnf file in your server
nano /etc/mysql/my.cnf
Step 2:
Compare your file content
[mysqld]
#innodb_force_recovery = 1
bind-address=0.0.0.0
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
Step 3: After Making Changes Restart Mysql Server
systemctl restart mysql
source : https://stackoverflow.com/questions/22407532/innodb-force-recovery-doesnt-set-to-zero-mysql