yum安装 1、yum源安装 yum install mariadb-server 2、启动MySQL服务 systemctl start mariadb 3、查看运行状态 systemctl status mariadb 4、设置初始密码 mysql -u root use mysql; update user set password=password("root")where user='root'; flush privileges; exit; 5、测试: mysql -u root -p