闲着无聊,把CentOS7上的MariaDB10.5.1 通过 yum 升级到了 MariaDB10.5.2
然后就发现~~ mariadb服务挂了~~
systemctl start mariadb
提示:
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
看看其它信息
system status mariadb
提示:
mariadb could not increase number of max_open_files....
.................一堆乱七八糟的
好吧,我查mariadb的启动日志吧。
我的数据目录已经迁移到 /home/MysqlDB/mariadb.log
而你的应该在默认安装目录中,具体自己百度吧,我忘记在哪了。
打开之~我们只看故障发生后的结尾部分~
2020-04-20 15:34:59 0 [Note] InnoDB: Using Linux native AIO
2020-04-20 15:34:59 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-04-20 15:34:59 0 [Note] InnoDB: Uses event mutexes
2020-04-20 15:34:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2020-04-20 15:34:59 0 [Note] InnoDB: Number of pools: 1
2020-04-20 15:34:59 0 [Note] InnoDB: Using generic crc32 instructions
2020-04-20 15:34:59 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2020-04-20 15:34:59 0 [Note] InnoDB: Completed initialization of buffer pool
2020-04-20 15:34:59 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-04-20 15:34:59 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.5.1.
2020-04-20 15:34:59 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2020-04-20 15:34:59 0 [Note] InnoDB: Starting shutdown...
2020-04-20 15:34:59 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-04-20 15:34:59 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-04-20 15:34:59 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-04-20 15:34:59 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-04-20 15:34:59 0 [ERROR] Aborting
注意第一个 error :Upgrade after a crash is not supported. The redo log was created with MariaDB 10.5.1.
它说:"不支持在崩溃后进行升级。redo日志是用MariaDB 10.5.1创建的。"
翻译成人话就是:由于redo log文件是早期版本(10.5.1)创建的,我不认识它。
参考了一个官方文档:https://mariadb.com/kb/en/upgrading-from-mariadb-101-to-mariadb-102/+comments/2903
处理办法是:删除mariadb目录下的 ib_logfile* 文件。
默认目录应该是在 /var/lib/mysql/ib_logfile*
把它改个名,然后尝试启动服务 systemctl start mariadb ......
成功!