無法啓動MySQL數據庫

問題:命令 $ 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.

命令$ journalctl -xe 找到問題反饋

查看MariaDB日記:

$ cd /var/log/mariadb

$vim mariadb.log

發現報錯:/usr/libexec/mysqld: unknown variable 'default-character-set=utf8'

錯誤定位:mariadb的配置文件  /etc/my.conf 

重新修改配置如下:

[mysqld]
character-set-server=utf8

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

再啓動:$ systemctl start mariadb

成功!

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章