1、使用yum安装
yum install mariadb-server
2、启动
systemctl start mariadb
3、设置开机自启
systemctl enable mariadb
4、配置
mysql_secure_installation
配置详细说明
#第一次安装是没有密码的,直接回车就行
Enter current password for root (enter for none):
#键入 y 设置root密码
Set root password? [Y/n]
#是否移除匿名用户
Remove anonymous users? [Y/n]
#是否禁止root远程登录,设置y或者n都是禁止的
Disallow root login remotely? [Y/n]
#是否移除测试数据库test
Remove test database and access to it? [Y/n]
#是否重载权限
Reload privilege tables now? [Y/n]
需要设置root远程登录数据库点击下面的连接:
https://blog.youkuaiyun.com/daxia5a0/article/details/103659473