CentOS7安装MariaDB数据库替代MySQL

1 安装

# 首先需要安装mariadb-server
yum install -y mariadb-server

# 启动服务
systemctl start mariadb.service

# 添加到开机启动
systemctl enable mariadb.service

2 进行一些安全设置,以及修改数据库管理员密码

[zhaojq@localhost]$  mysql_secure_installation
image.png

3 mysql给root开启远程访问权限

use mysql;
select  User,authentication_string,Host from user;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123';
flush privileges;
  • 转载自https://www.jianshu.com/p/7eefa113f303

你可能感兴趣的:(CentOS7安装MariaDB数据库替代MySQL)