第一步:安裝從網上下載檔案的wget命令
[root@master ~]# yum -y install wget
第二步:下載mysql的repo源
[root@master ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
第三步:安裝mysql-community-release-el7-5.noarch.rpm包
[root@master ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
第四步:檢視下
[root@master ~]# ls -1 /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo
會獲得兩個mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo。
第五步:安裝mysql
[root@master ~]# yum install mysql-server