1. 程式人生 > >centos7下安裝mysql 並解決yum install mysql-server沒有可用包

centos7下安裝mysql 並解決yum install mysql-server沒有可用包

第一步:安裝從網上下載檔案的wget命令

[[email protected] ~]# yum -y install wget

第二步:下載mysql的repo源

[[email protected] ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 

第三步:安裝mysql-community-release-el7-5.noarch.rpm包

[[email protected] ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm

第四步:檢視下

[[email protected] ~]# 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

[[email protected] ~]# yum install mysql-server