我刚刚安装了 mariadb 包并且无法工作(无法启动),我有以下输出:
systemctl status -l mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: inactive (dead)
日记ctl | grep 玛丽亚数据库 |尾巴
action org.freedesktop.systemd1.manage-units for system-bus-name::1.110 [systemctl start mariadb.service] (owned by unix-user:velzm)
dic 04 08:17:21 nmveliz systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
dic 04 08:17:21 nmveliz systemd[1]: mariadb.service: Unit entered failed state.
dic 04 08:17:21 nmveliz systemd[1]: mariadb.service: Failed with result 'exit-code'.
systemctl 状态 mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; ven
Active: failed (Result: exit-code) since Sat 2016-12-03 16:44:12 CST;
Process: 1959 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUST
Process: 1906 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ]
Process: 1903 ExecStartPre=/bin/sh -c systemctl unset-environment _WSRE
Main PID: 1959 (code=exited, status=1/FAILURE)
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396413908
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396419816
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396419816
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396419816
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396419816
dic 03 16:44:12 nmveliz mysqld[1959]: 2016-12-03 16:44:12 1396419816
dic 03 16:44:12 nmveliz systemd[1]: mariadb.service: Main process ex
dic 03 16:44:12 nmveliz systemd[1]: Failed to start MariaDB database
dic 03 16:44:12 nmveliz systemd[1]: mariadb.service: Unit entered fa
dic 03 16:44:12 nmveliz systemd[1]: mariadb.service: Failed with res
lines 1-18/18 (END)
日志控制-xe
dic 03 16:56:30 nmveliz mysqld[2707]: 2016-12-03 16:56:30 1401676738
dic 03 16:56:30 nmveliz mysqld[2707]: 2016-12-03 16:56:30 1401676738
dic 03 16:56:30 nmveliz mysqld[2707]: 2016-12-03 16:56:30 1401676738
dic 03 16:56:31 nmveliz mysqld[2707]: 2016-12-03 16:56:31 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:32 nmveliz mysqld[2707]: 2016-12-03 16:56:32 1401676738
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676738
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401670818
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676738
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676737
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676738
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676738
dic 03 16:56:33 nmveliz mysqld[2707]: 2016-12-03 16:56:33 1401676738
dic 03 16:56:33 nmveliz systemd[1]: mariadb.service: Main process ex
dic 03 16:56:33 nmveliz systemd[1]: Failed to start MariaDB database
-- 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.
dic 03 16:56:33 nmveliz systemd[1]: mariadb.service: Unit entered fa
dic 03 16:56:33 nmveliz systemd[1]: mariadb.service: Failed with res
dic 03 16:56:33 nmveliz sudo[2649]: pam_unix(sudo:session): session
答案1
我在安装 Antergos 时遇到了同样的问题。
它接缝 mariadb 没有正确安装并且无法访问其目录
我解决了我的问题...
sudo mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
但还有另一种解决方案,将 /var/lib/mysql 的所有权更改为 mysql 用户和组
sudo chown mysql:mysql -R /var/lib/mysql
https://stackoverflow.com/questions/31813552/linux-antergos-install-mysql