innodb_force_recovery
This page is part of MariaDB's Documentation.
The parent of this page is: System Variables for MariaDB Enterprise Server
Topics on this page:
Overview
Disables certain InnoDB background and crash recovery operations to forcefully recover data from a corrupt database.
DETAILS
The default value of 0
means that InnoDB is running normally.
The recovery mode behavior depends on the MariaDB server version, see the tables below for details.
In MariaDB 10.5 and later: Write transactions are permitted with
innodb_force_recovery<=4
In MariaDB 10.4 and earlier: Write transactions are permitted with
innodb_force_recovery<=3
In MariaDB 10.2.6 and earlier: Write transactions are only permitted with
innodb_force_recovery=0
Regardless of the version of the MariaDB server, the values 5
and 6
can lead to data corruption and should be used very carefully and only if you have a database backup.
Mode | Description |
---|---|
| The default mode while InnoDB is running normally. |
| Allows the server to keep running even if corrupt pages are detected. It does so by making redo log based recovery ignore certain errors, such as missing data files or corrupted data pages. Any redo log for affected files or pages will be skipped. You can facilitate dumping tables by getting the |
| Stops the master thread from running, preventing a crash that occurs during a purge. No purge will be performed, so the undo logs will keep growing (internal name |
| Does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions, also prevents some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented (internal name |
| Does not calculate tables statistics and prevents insert buffer merges (internal name
|
| Treats incomplete transactions as committed, and does not look at the undo logs when starting (internal name
|
| Does not perform redo log roll-forward as part of recovery. Running queries that require indexes are likely to fail with this mode active. However, if a table dump still causes a crash, you can try using a |
PARAMETERS
Command-line | --innodb_force_recovery=# |
Configuration file | Supported |
Dynamic | No |
Scope | Global |
Data Type | BIGINT UNSIGNED |
Minimum Value | 0 |
Maximum Value | 6 |
Product Default Value | 0 |