yum install mariadb mariadb-server
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
启动MariaDB
输入: mysql_secure_installation
第一次直接回车,后面的根据提示操作
允许本地访问:
grant all PRIVILEGES on *.* to root@'localhost' identified by 'zxc123' with grant option
允许远程访问:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'zxc13' WITH GRANT OPTION