沒法啓動MySQL數據庫

問題:命令 $ systemctl start mariadbmysql

報錯 :Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.sql

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

查看MariaDB日記:socket

$ cd /var/log/mariadbspa

$vim mariadb.logcode

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

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

從新修改配置以下:io

[mysqld]
character-set-server=utf8
event

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

成功!

相關文章
相關標籤/搜索