标签归档:yum

CentOS 7下yum安装MariaDB

CentOS 7下mysql下替换成MariaDB了。

把以下内容放到 /etc/yum.repos.d/MariaDB.repo 文件中

# MariaDB 10.4 CentOS repository list - created 2019-11-27 06:40 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

更多发行版:https://downloads.mariadb.org/mariadb/repositories/

安装

yum install mariadb mariadb-server
systemctl start mariadb   #启动mariadb
systemctl enable mariadb  #设置开机自启动
mysql_secure_installation #设置root密码等相关
mysql -uroot -p           #测试登录

centos 7 清理 yum 缓存

CentOS 7 update 时出现 正在尝试其它镜像 的解决办法:

sudo yum clean all && sudo yum clean metadata && sudo yum clean dbcache && sudo yum makecache && sudo yum update