我是这样用的:
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
uname -r
5.10.102.1-microsoft-standard-WSL2
Operating system
Windows 11 Pro
* version
21H2
* build
22000.708
* experience
Windows Feature Experience Pack 1000.22000.708.0.
输出如下:
sudo mariadb --version
* mariadb Ver 15.1 Distrib 10.6.7-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
sudo service mariadb restart
* Stopping MariaDB database server mariadbd [ OK ]
* Starting MariaDB database server [fail]
sudo service mariadb status
* MariaDB is stopped.
注意error.log
中的日期,这是一些较旧的错误。与此无关。我在重新安装时检查了error.log
,它是空的,仍然无法启动。
nano /var/log/mysql/error.log
* 2022-03-29 15:43:59 0 [Warning] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
* 2022-03-29 15:43:59 0 [Warning] InnoDB: Linux Native AIO disabled.
sudo mysqld --verbose --user root
* 2022-06-02 13:27:16 0 [Note] mysqld (server 10.6.7-MariaDB-1:10.6.7+maria~focal) starting as process 1445 ...
* 2022-06-02 13:27:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
* 2022-06-02 13:27:16 0 [Note] InnoDB: Number of pools: 1
* 2022-06-02 13:27:16 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
* 2022-06-02 13:27:16 0 [Note] InnoDB: Using Linux native AIO
* 2022-06-02 13:27:16 0 [Note] InnoDB: Initializing buffer pool, total size = 4294967296, chunk size = 134217728
* 2022-06-02 13:27:16 0 [Note] InnoDB: Completed initialization of buffer pool
* 2022-06-02 13:27:16 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=10162222816,10254949185
* 2022-06-02 13:27:16 0 [ERROR] InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT for tablespace 724
* 2022-06-02 13:27:16 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
* 2022-06-02 13:27:16 0 [Note] InnoDB: Starting shutdown...
* 2022-06-02 13:27:17 0 [ERROR] Plugin 'InnoDB' init function returned error.
* 2022-06-02 13:27:17 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
* 2022-06-02 13:27:17 0 [Note] Plugin 'FEEDBACK' is disabled.
* 2022-06-02 13:27:17 0 [ERROR] Unknown/unsupported storage engine: InnoDB
* 2022-06-02 13:27:17 0 [ERROR] Aborting
安装程序已经正常工作了几个月了。我重新启动了我的电脑,有一个Windows更新,现在我不能再启动mariadb了。
这个问题是什么,为什么突然发生了?
*如果它是相关的,这是Windows更新:
Update for Windows Security platform - KB5007651 (Version 1.0.2109.27002)
更新记录
更新刚刚彻底清除/卸载了我系统上的所有Ubuntu和WSL。
然后我按照这里的指导一步一步地安装:https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview
然后安装了MariaDBsudo apt install mariadb-server
.
sudo service mariadb start
我再次得到[FAIL],所以它也发生在新安装上。这一次,Ubuntu上没有任何日志。
对于那些想要"完整的崩溃日志"的人来说,我所拥有的error.log
中的两行就是全部。
对于那些问的人,这是我的my.cnf
:
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/
#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
更新# 2我已经张贴了一个答案的工作。总之,这是WSL的问题。
我的兄弟发现Ubuntu WSL的github问题与MySQL产生相同的AIO错误。
这是我的工作:
sudo apt remove --purge *mysql*
sudo apt remove --purge *mariadb*
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
请注意我在OP中的编辑,我完全重新安装了WSL和Ubuntu,所以它在新安装时也会发生。
还要注意,这完全清除了我拥有的所有数据。
总之,这是WSL的问题,而不是MariaDB的问题。
github上的问题:
- https://github.com/microsoft/WSL/issues/3631 issuecomment - 1145856044
消息表明正在使用libaio
接口(与较新的io_uring
相对)。在该接口中,至少在普通Linux内核中,io_setup()
系统调用可能会失败,从而导致回退到模拟的异步I/O (innodb_use_native_aio=0
)。
恢复失败可能是由MDEV-12353在MariaDB Server 10.5中引入的MDEV-28731错误造成的。