CentOS7 MariaDB

来源:互联网 发布:金融理财软件排名 编辑:程序博客网 时间:2024/06/05 02:04

安装MariaDB

yum install -y mariadb mariadb-server

启动程序

systemctl start mariadb

启动管理客户端

mysql

启动远程连接

grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;flush privileges;

配置数据库

修改数据存储目录

# 创建数据目录mkdir /data/mysql
# 目录授权# chmod 777 /data/mysql/chown -R mysql:mysql /data/mysql/
vi /etc/my.cnf
[mysqld]datadir=/data/mysql/datasocket=/data/mysql/mysql.sock# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-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=/data/mysql/logs/mariadb.logpid-file=/data/mysql/mariadb.pid## include all files from the config directory#!includedir /etc/my.cnf.d

关闭SELinux

临时关闭,不用重启

setenforce 0

永久关闭

vi /etc/selinux/config
SELINUX=disabled