MariaDB的安装与启动
1.安装前需要删除系统已存在的mysql及mariadb
[root@vm172-31-0-6 ~]# rpm -qa|grep mysql
[root@vm172-31-0-6 ~]# rpm -qa|grep mariadb
mariadb-5.5.60-1.el7_5.x86_64
mariadb-libs-5.5.60-1.el7_5.x86_64
使用 yum remove 全部卸载
[root@vm172-31-0-6 ~]# yum remove mysql*
[root@vm172-31-0-6 ~]# yum remove mariadb*
删除多余的文件
[root@vm172-31-0-6 ~]# find / -name mysql
[root@vm172-31-0-6 ~]# find / -name mariadb
2.安装mariadb
[root@vm172-31-0-6 ~]# yum install mariadb* -y
3.启动并添加开机自启
[root@vm172-31-0-6 ~]# systemctl start mariadb
[root@vm172-31-0-6 ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
4.常用启动停止命令
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动