vim /etc/yum.repos.d/mysql-community.repo
--------------------------------------
将5.7的源打开,将5.7的gpgcheck关闭将8.0的源关闭
--------------------------------------------
[mysql57-community]name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1##把enabled从0改为1gpgcheck=0##把gpgcheck从1改为0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql80-community]name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=0##把enabled从1改为0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql