我嘗試啟動我的 mariadb,但我無法啟動 maria db,我不知道為什麼......我正在使用 mariadb 運行 centos 7。當我重新啟動時它會啟動,當我使用 cli 啟動它時它會顯示以下內容:
[root@localhost mariadb]# systemctl start mariadb.service
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
當我檢查日記時,它給了我這個錯誤:
[root@localhost mariadb]# journalctl -xn
-- Logs begin at Sun 2015-05-17 12:38:39 CEST, end at Sun 2015-05-17 13:51:37 CEST. --
May 17 13:45:10 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
May 17 13:51:35 localhost.localdomain systemd[1]: Starting MariaDB database server...
-- Subject: Unit mariadb.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
May 17 13:51:35 localhost.localdomain mariadb-prepare-db-dir[7079]: Failed to get D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
May 17 13:51:35 localhost.localdomain mariadb-prepare-db-dir[7079]: Failed to get D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
May 17 13:51:35 localhost.localdomain mysqld_safe[7107]: 150517 13:51:35 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
May 17 13:51:35 localhost.localdomain mysqld_safe[7107]: 150517 13:51:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
May 17 13:51:36 localhost.localdomain mysqld_safe[7107]: 150517 13:51:36 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
May 17 13:51:37 localhost.localdomain systemd[1]: mariadb.service: control process exited, code=exited status=1
May 17 13:51:37 localhost.localdomain systemd[1]: Failed to start MariaDB 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.
May 17 13:51:37 localhost.localdomain systemd[1]: Unit mariadb.service entered failed state.
如何修復無法取得 D-Bus 連線:無法連線到套接字 /var/run/dbus/system_bus_socket:沒有此類檔案或目錄錯誤?
答案1
當使用以下命令時它是固定的:
[root@localhost mariadb]# nano /etc/my.cnf
然後我取消註解我的pid文件
#pid-file=/var/run/mariadb/mariadb.pid
然後我重新啟動 mariadb