C Morell
C Morell

Reputation: 89

MySql : InnoDB_Force_recovery = 1 leads to table in read only

I have an application which runs under MariaDB 10.1.18 and I had problems of data corruption. So, in my.cnf I change the parameter innoDB_force_recovery = 1 to ignore them. But then, I can not make insert in tables. But I thought that insert are forbidden when innoDB_force_recovery = 4. Is it possible to make insert when innoDB_force_recovery = 1 ? Best regards. Christophe

Upvotes: 4

Views: 21700

Answers (1)

user149341
user149341

Reputation:

Setting innodb_force_recovery=1 does not fix data corruption! It ignores corruption to allow you to back up your data before rebuilding the database.

Only set this variable to a value greater than 0 in an emergency situation, so that you can start InnoDB and dump your tables. As a safety measure, InnoDB prevents INSERT, UPDATE, or DELETE operations when innodb_force_recovery is greater than 0.

So, no. You cannot insert data while innodb_force_recovery is active. Use mysqldump to create a backup of all data, then delete the MySQL data files and use your backup to restore it.

Upvotes: 11

Related Questions