yum install mysql-server mysql-libs mysql來安裝mysql,報如下錯誤
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.skyshe.cn * extras: mirrors.zju.edu.cn * updates: centos.ustc.edu.cn No package mysql-server available. Package 1:mariadb-libs-5.5.47-1.el7_2.x86_64 already installed and latest version Package 1:mariadb-5.5.47-1.el7_2.x86_64 already installed and latest version Nothing to do其中,出現
No package mysql-server available.之類的錯誤的話,是因為CentOs7采用MariaDB來代替Mysql,可以使用
yum -y install mariadb-server mariadb來安裝。如果要按照原來方法安裝MySQL的話,添加如下語句
sudo rpm -Uvh' target='_blank'>http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm[/code] 這樣就可以按照原來方法安裝MySQL了。
參考:https://www.digitalocean.com/community/questions/can-t-install-mysql-on-centos-7
http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html