Centos7上MariaDB数据库启动问题解决

安装MariaDB数据库后出现服务启动失败问题,

解决办法:卸载再安装!(确定无3306端口占用)

一、卸载数据库: [root@localhost logs]# yum -y remove mariadb*

二、删除数据库文件: [root@localhost logs]# rm -rf /var/lib/mysql/*

三、安装数据库: yum -y install mariadb mariadb-server

确定my.cnf配置文件无错

[mysqld]
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

原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11660211.html