linux安装MySQL5.7遇到的麻烦

在CentOS6上安装MySQL的时候,运行下面的命令报错:

# yum install mysql-community-server

报错的大意是libc++库找不到:

……
–> Finished Dependency Resolution
Error: Package: mysql-community-server-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: systemd
Error: Package: mysql-community-client-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-libs-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-server-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-server-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libsasl2.so.3()(64bit)
Error: Package: mysql-community-client-5.7.22-1.el7.x86_64 (mysql57-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
……

经查有两个原因:

1.低级错误,我是6.x的系统,用了7.0的RPM源

2.因为系统中的glibc版本太低造成的,将glibc进行升级就可以了。

解决方法:

1.下载和系统匹配的RPM源。

# wget dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
# yum -y remove mysql-libs.x86_64
# yum clean all

接下来再按照官方的步骤安装即可:

https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

2.升级glibc (一般系统不会需要这步)

# wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
# tar xvf glibc-2.14.tar.gz
# cd glibc-2.14
# mkdir build
# cd build
# ../configure –prefix=/opt/glibc-2.14
# make
# make install

安装成功的结果:



郑重声明:
除特别声明为转载内容外,本站所有内容均为作者原创,谢绝任何单位和个人不经许可的复制和转播!
对于确有转载需要的,请先与作者联系,在获得允许后烦请在转载时保留文章出处。
本文出自Lupin's Blog:http://www.cnzui.com/archives/1253