好吧,这让我很抓狂。Ubuntu 20.04.5 LTS(在 WSL 上)
我假设它崩溃了,然后升级了 mysql,现在它无法启动:
2022-08-31T16:37:29.463168Z 1 [ERROR] [MY-012526] [InnoDB] Upgrade is not supported after a crash or shutdown with innodb_fast_shutdown = 2. This redo log was created with MySQL 8.0.28, and it appears logically non empty. Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/upgrading.html
2022-08-31T16:37:29.463211Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2022-08-31T16:37:29.842520Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-08-31T16:37:29.842925Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-31T16:37:29.842966Z 0 [ERROR] [MY-010119] [Server] Aborting
我尝试删除重做日志 ib_logfile0 和 ib_logfile1,然后我得到:
2022-09-03T16:56:05.188621Z 1 [ERROR] [MY-013862] [InnoDB] Neither found #innodb_redo subdirectory, nor ib_logfile* files in ./
2022-09-03T16:56:05.188663Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2022-09-03T16:56:05.672331Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-09-03T16:56:05.672561Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-09-03T16:56:05.672585Z 0 [ERROR] [MY-010119] [Server] Aborting
还尝试删除 ibdata1,我得到了
2022-09-03T17:20:34.205872Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2022-09-03T17:20:34.205907Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2022-09-03T17:20:34.205914Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2022-09-03T17:20:34.205929Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2022-09-03T17:20:34.205977Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
我想我可以降级到 8.0.28 但肯定有办法恢复吗?
我尝试了各种 innodb_force_recovery 设置,但都无济于事。
请问我该如何修复此问题?
谢谢
答案1
我在将 mysql 更新到 8.0.30 版本时遇到了类似的问题,我通过创建 #innodb_redo 文件夹解决了该问题
cd /var/lib/mysql
mkdir #innodb_redo
chown mysql:mysql #innodb_redo
systemctl start mysql
答案2
但是如果“#”是非法字符,您如何创建 #innodb_redo。我收到“缺少操作数”消息,无法在 Fedora 39 上创建。– user3158591
vuser@fedora39-ssd-2TB:~$ cd /var/lib/mysql
vuser@fedora39-ssd-2TB:/var/lib/mysql$ sudo mkdir '#innodb_redo'
vuser@fedora39-ssd-2TB:/var/lib/mysql$ sudo chown mysql:mysql' #innodb_redo'
vuser@fedora39-ssd-2TB:/var/lib/mysql$ sudo service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service