MariaDb/MySQL how to fix Unknown/unsupported storage engine: InnoDB

If you changed /etc/my.cnf "innodb_log_file_size" setting, then may get this error:

 [ERROR] InnoDB: Unrecognized value JO_DIRECT for innodb_flush_method
 [ERROR] Plugin 'InnoDB' init function returned error.
 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

You probably tried the following fix:

rm /var/lib/mysql/ib_logfile0  
rm /var/lib/mysql/ib_logfile1

However, if you set innodb_log_file_size to something large like 2G,  and tried restarting mysqld, the startup will seem like it's taking FOREVER (and it does, compared to regular startup)... and you probably force quit the restart, thinking something is wrong.

If you did this, then you interrupted a PROPER restart, including the necessary rebuild of /var/lib/mysql/ib_logfile* which will easily take over 5+ minutes on a fast SSD system.


Here's the fix:

rm -rf /var/lib/mysql/ib_logfile*
​service mysqld restart

Now monitor the mysqld log file, so you know what's going on, and see the actual (long) progress.

tail -f /var/lib/mysql/SERVER_NAME.err

This way you'll be able to monitor what's going on without wondering what the hell is taking so long...