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)
journalctl | grep mariadb |尾
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 status 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)
journalctl -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
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