mariadb启动报错:failed to start mariadb database server
背景:很奇怪,mysql一直运行好好的,突然连不上去了,查看进程,发现mysql进程都没有了!!!
[root@host-39-108-217-12 mariadb]# systemctl status mariadb.service
mariadb.service - mariadb database server
loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
active: failed (result: exit-code) since fri 2018-07-06 08:54:32 cst; 1min 18s ago
process: 29269 execstartpost=/usr/libexec/mariadb-wait-ready $mainpid (code=exited, status=1/failure)
process: 29268 execstart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/success)
process: 29238 execstartpre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/success)
main pid: 29268 (code=exited, status=0/success)
jul 06 08:54:31 host-39-108-217-12 systemd[1]: starting mariadb database server...
jul 06 08:54:31 host-39-108-217-12 mariadb-prepare-db-dir[29238]: database mariadb is probably initialized in /var/lib/mysql/data already, nothing is done.
jul 06 08:54:31 host-39-108-217-12 mysqld_safe[29268]: 180706 08:54:31 mysqld_safe logging to '/var/lib/mysql/logs/mariadb.log'.
jul 06 08:54:31 host-39-108-217-12 mysqld_safe[29268]: 180706 08:54:31 mysqld_safe starting mysqld daemon with databases from /var/lib/mysql/data
jul 06 08:54:32 host-39-108-217-12 systemd[1]: mariadb.service: control process exited, code=exited status=1
jul 06 08:54:32 host-39-108-217-12 systemd[1]: failed to start mariadb database server.
jul 06 08:54:32 host-39-108-217-12 systemd[1]: unit mariadb.service entered failed state.
jul 06 08:54:32 host-39-108-217-12 systemd[1]: mariadb.service failed.
查看mariadb错误信息
[root@host-39-108-217-12 mariadb]# grep 'error' /var/lib/mysql/logs/mariadb.log
180706 8:47:23 [error] plugin 'innodb' init function returned error.
180706 8:47:23 [error] plugin 'innodb' registration as a storage engine failed.
180706 8:47:23 [error] unknown/unsupported storage engine: innodb
180706 8:47:23 [error] aborting
180706 8:48:48 [error] plugin 'innodb' init function returned error.
180706 8:48:48 [error] plugin 'innodb' registration as a storage engine failed.
180706 8:48:48 [error] unknown/unsupported storage engine: innodb
180706 8:48:48 [error] aborting
180706 8:49:38 [error] plugin 'innodb' init function returned error.
180706 8:49:38 [error] plugin 'innodb' registration as a storage engine failed.
180706 8:49:38 [error] unknown/unsupported storage engine: innodb
180706 8:49:38 [error] aborting
180706 8:54:31 [error] plugin 'innodb' init function returned error.
180706 8:54:31 [error] plugin 'innodb' registration as a storage engine failed.
180706 8:54:31 [error] mysqld: out of memory (needed 128917504 bytes)
180706 8:54:31 [error] unknown/unsupported storage engine: innodb
180706 8:54:31 [error] aborting
经分析发现内存不足,重启一下服务器即可!!!