CentOS7 MariaDB

安装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
mkdir /data/mysql/data
mkdir /data/mysql/logs
# 目录授权
# chmod 777 /data/mysql/
chown -R mysql:mysql /data/mysql/
vi /etc/my.cnf
[mysqld]
datadir=/data/mysql/data
socket=/data/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=/data/mysql/logs/mariadb.log
pid-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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值