由于我的MySQL是自己编译安装,但是安装之后/etc/yum.repos.d/目录下并没有MySQL的源,导致我在安装mysql-devel出错。
yum install -y mysql-devel
会有类似这样的提示:
Error: Package: 1:mariadb-devel-5.5.50-1.el7_2.x86_64 (updates)
Requires: libmysqlclient.so.18()(64bit)
Available: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (base)
libmysqlclient.so.18()(64bit)
Available: 1:mariadb-libs-5.5.47-1.el7_2.x86_64 (updates)
libmysqlclient.so.18()(64bit)
Available: 1:mariadb-libs-5.5.50-1.el7_2.x86_64 (updates)
libmysqlclient.so.18()(64bit)
安装mysql5.7的源解决:
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# rpm -ivh http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
[root@localhost ~]# yum install mysql-devel