我一安装就无法启动mariadb.service

时间:2018-01-20 17:36:46

标签: database centos mariadb centos7

我在我的CentOS7中安装了mariadb,“systemctl start mariadb”命令不起作用。控制台输出就是这个 - > “Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

[root@centos ~]# journalctl -xe
 1월 21 00:31:34 centos systemd[1]: mariadb.service failed.
 1월 21 00:31:34 centos polkitd[828]: Unregistered Authentication Agent for unix-process:3046:129841 (system bus name :1
 1월 21 00:31:53 centos fprintd[3001]: No devices in use, exit
 1월 21 00:32:07 centos polkitd[828]: Registered Authentication Agent for unix-process:3087:133140 (system bus name :1.1
 1월 21 00:32:07 centos systemd[1]: Starting MariaDB 10.1.30 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has begun starting up.
 1월 21 00:32:07 centos mysqld[3110]: /usr/sbin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot o
 1월 21 00:32:07 centos systemd[1]: mariadb.service: main process exited, code=exited, status=127/n/a
 1월 21 00:32:07 centos systemd[1]: Failed to start MariaDB 10.1.30 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
 1월 21 00:32:07 centos systemd[1]: Unit mariadb.service entered failed state.
 1월 21 00:32:07 centos systemd[1]: mariadb.service failed.
 1월 21 00:32:07 centos polkitd[828]: Unregistered Authentication Agent for unix-process:3087:133140 (system bus name :1
lines 3201-3223/3223 (END)

我长时间搜索解决这个问题,我找不到合适的解决方案。 / var / log / mariadb目录不存在。

我该如何解决这个问题?请帮帮我!

(更新)

[root@kyun2centos ~]# journalctl -xe|grep 'error'
 1월 23 16:47:12 kyun2centos gnome-settings-[2077]: g_task_return_error: assertion 'error != NULL' failed
 1월 23 20:30:53 kyun2centos mysqld[3754]: /usr/sbin/mysqld: error while loading shared libraries: libjemalloc.so.1: cannot open shared object file: No such file or directory
 1월 23 20:33:11 kyun2centos mysqld[3841]: 2018-01-23 20:33:11 140616961231104 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:33:32 kyun2centos mysqld[3964]: 2018-01-23 20:33:32 139707756554496 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:42:37 kyun2centos mysqld[4274]: 2018-01-23 20:42:37 140639461787904 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:43:12 kyun2centos mysqld[4365]: 2018-01-23 20:43:12 140563394230528 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:48:04 kyun2centos mysqld[4553]: 2018-01-23 20:48:04 139807531911424 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:50:04 kyun2centos mysqld[4654]: 2018-01-23 20:50:04 140253162838272 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
 1월 23 20:57:30 kyun2centos mysqld[4901]: 2018-01-23 20:57:30 140003728230656 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

2 个答案:

答案 0 :(得分:0)

表示缺少库。所以运行

yum install libaio

yum会帮助您安装和配置它,或者您可以访问website下载最新的rpm包并手动安装。

答案 1 :(得分:0)

OP解决方案。

我通过以下一系列命令解决了这个问题:

yum -y remove mariadb-libs
yum -y remove mariadb mariadb-server
cd /var/lib/ && rm -rfv mysql
yum -y install mariadb mariadb-server