yum 命令安装
yum -y install mariadb mariadb-server
启动
systemctl start mariadb
设置开机启动
systemctl enable mariadb
配置
mysql_secure_installation
Enter current password for root (enter for none): #初次运行直接回车
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y #设置密码
New password: #输入新密码
Re-enter new password: #确认密码
Password updated successfully!
Reloading privilege tables..
... Success!
Remove anonymous users? [Y/n] n #是否删除匿名用户
... skipping.
Disallow root login remotely? [Y/n] y #是否禁止root远程登录
... Success!
Remove test database and access to it? [Y/n] n #是否删除test数据库
... skipping.
Reload privilege tables now? [Y/n] y #是否重新加载权限表
... Success!
开放端口
#查看开放的所有端口
firewall-cmd --list-all
#开放3306端口
firewall-cmd --add-port=3306/tcp
修改存储路径