简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM