3

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

C Morell
  • 81
  • 1
  • 3
  • 10

1 Answers1

8

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.