CentOS7使用yum安装mysql5.7

  提前说一下,网速不好不要用yum安装,等得时间太长。

第一步、获取yum源

[root@youxi1 ~]# rpm  -ivh https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
获取https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
警告:/var/tmp/rpm-tmp.ztTcV0: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:mysql57-community-release-el7-10 ################################# [100%]

  https://repo.mysql.com是可以查看目录结构的网址,可以根据需求查找需要的mysql源。

第二步、查看yum源

[root@youxi1 ~]# yum list | grep mysql-community-server
mysql-community-server.x86_64           5.7.26-1.el7                   mysql57-community

第三步、安装mysql

[root@youxi1 ~]# yum -y install mysql-community-server

  使用yum安装的好处在于,它会自动安装依赖包,以及替换包(例如CentOS7中的mariadb-libs.x86_64 1:5.5.60-1.el7_5)

之后的配置和rpm安装是一样的,详细请查看:CentOS7使用rpm安装mysql5.7

原文地址:https://www.cnblogs.com/diantong/p/10962754.html