yum 安装mariadb
参考地址
https://www.cnblogs.com/river2005/p/6813618.html
1、搜索删除已安装
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-server-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
[root@localhost ~]# rpm -e mysql-*
错误:未安装软件包 mysql-*
[root@localhost ~]# yum remove mysql mysql-server mysql-libs compat-mysql51
2、开始新的安装, 创建MariaDB.repo文件
内容 --------
MariaDB 10.2.4 CentOS repository list - created 2017-05-05 16:13 UTC
http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
3、安装
yum -y install MariaDB-server MariaDB-client
4、启动
systemctl start mariadb #启动服务
systemctl enable mariadb #设置开机启动
systemctl restart mariadb #重新启动
systemctl stop mariadb.service #停止MariaDB
5登录到数据库
用mysql -uroot命令登录到MariaDB,此时root账户的密码为空。
6.进行MariaDB的相关简单配置,使用mysql_secure_installation命令进行配置。
mysql_secure_installation