centos7安装mysql报错问题

如果采用命令

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 http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

这样就可以按照原来方法安装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

你可能感兴趣的:(数据库)