0

MariaDB 10.7 service suddenly stopped in Windows 10 after a crash and the service is not starting. The pop up shows 'windows cannot start mariadb service). The windows event viewer gives the following data:

  • InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
  • InnoDB: Page [page id: space=0, page number=366] log sequence number 424180275 is in the future! Current system log sequence number 408454168.
  • InnoDB: unsupported undo header type 16
  • InnoDB: Plugin initialization aborted with error Data structure corruption
  • Plugin 'InnoDB' init function returned error.
  • Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  • Unknown/unsupported storage engine: InnoDB
  • InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT for tablespace 251

Cannot restart the MaraDB service.

1 Answer 1

2

Step 1:

Locate the configuration file

  • Win + R (shortcut for 'run'), type services.msc, Enter
  • Find the entry named 'MariaDB', right click on it, select properties
  • You should see something like "F:\Program Files\MariaDB\MariaDB 10.7\bin\mysqld.exe" "--defaults-file=F:\Program Files\MariaDB\MariaDB 10.7\data\my.ini" "MariaDB"

F:\Program Files\MariaDB\MariaDB 10.7\data\my.ini is the location for the configuration file my.ini.

For Linux users find the configuration file location: https://stackoverflow.com/questions/2482234/how-do-i-find-the-mysql-my-cnf-location

Step 2:

  • Open the configuration file (my.ini in Windows, my.cnf in Linux) in any available editor (ex. Notepad in Windows)
  • add innodb_force_recovery=1 after [mysqld]
  • Save the file

Now try starting the server (You can start it from the Windows service manager we used to find the configuration file. In Linux, the command service mariadb start would be suffice).

Note:

innodb_force_recovery value can range from 1 to 6. Try higher values if smaller ones fail. If it works for 5 and above, it is likely that the data is corrupt. On table operations it will produce errors like:

  • table is readonly,
  • mysql error 194 Tablespace is missing for a table

In this case:

  1. Locate the data directory in the configuration file (ex. datadir=C:/ProgramData/MariaDB/MariaDB 10.7/data)
  2. create a new data directory (ex. C:/ProgramData/MariaDB/MariaDB 10.7/data2)
  3. Update the value of datadir=<C:/ProgramData/MariaDB/MariaDB 10.7/data2> in the configuration file and save.
  4. Start the server.

STEP 3:

If the server starts peacefully, dont forget to remove the innodb_force_recovery=X line from my.ini and restart.

I hope this helps someone struggling to start MariaDB in Windows after a corrupted InnoDB engine failing to start.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.