大家好,我是后来,我会分享我在学习和工作中遇到的点滴,希望有机会我的某篇文章能够对你有所帮助,所有的文章都会在公众号首发,欢迎大家关注我的公众号" 后来X大数据 ",感谢你的支持与认可。
因为要在centos7 安装mysql8,在安装的时候遇到了这个鬼问题,头疼
# 安装mysql rpm -ivh mysql-*.rpm [root@bigdata101 mysql-lib]# rpm -ivh mysql-community-client-8.0.19-1.el8.x86_64.rpm warning: mysql-community-client-8.0.19-1.el8.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: libc.so.6(GLIBC_2.28)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libcrypto.so.1.1()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libncurses.so.6()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libssl.so.1.1()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libssl.so.1.1(OPENSSL_1_1_0)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libssl.so.1.1(OPENSSL_1_1_1)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libstdc++.so.6(CXXABI_1.3.9)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 libtinfo.so.6()(64bit) is needed by mysql-community-client-8.0.19-1.el8.x86_64 mysql-community-libs(x86-64) >= 8.0.11 is needed by mysql-community-client-8.0.19-1.el8.x86_64但是下面的glibc 2.17升级2.28的内容还是可以的。
然后我就去官网下载了Glibc2.28打算安装,官网地址:http://ftp.gnu.org/gnu/glibc/(选择你想要的版本)
# 完整步骤: tar -xf glibc-2.28.tar.gz cd glibc-2.28 mkdir build; cd build ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make make install # 这一步的2个问题可以忽略 ls -l /lib64/libc.so.6 # 最后来看看我们的结果吧 strings /lib64/libc.so.6 | grep GLIBC ..... GLIBC_2.26 GLIBC_2.27 GLIBC_2.28 GLIBC_PRIVATE事情并不顺利,它对应的gcc等版本也需要升级,所以就开始我的升级之路。以下截图是我glibc 2.28安装的报错 通过上面的报错,看到很多显示no和bad信息的都是版本不够
make 官方下载地址:https://ftp.gnu.org/gnu/make/
# 解压 tar -zxvf make-4.2.1.tar.gz # 安装 cd make-4.2.1 # 建立编译目录 mkdir build cd build # 执行 ../configure --prefix=/usr # 执行完,这里需要编译,会生成build.sh文件,然后执行这个文件 sh build.sh # 然后安装 make install # 然后就安装完成了,查看版本 make -v GNU Make 4.2.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.先看版本:
bison -V bash: bison: command not found bison -v bash: bison: command not found这就是没装啊,那就直接yum安装吧:
yum install -y bison再来看看版本:
bison --version bison (GNU Bison) 3.0.4 Written by Robert Corbett and Richard Stallman. Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.结果非常惊喜,没有报错啦。那就继续吧
make结果又是一个报错,心态要奔了
./../include/libc-symbols.h:534:26: error: ‘__EI___errno_location’ specifies less restrictive attributes than its target ‘__errno_location’: ‘const’, ‘nothrow’ [-Werror=missing-attributes] 534 | extern __typeof (name) __EI_##name \ | ^~~~~ ./../include/libc-symbols.h:538:29: note: in expansion of macro ‘__hidden_ver1’ 538 | # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); | ^~~~~~~~~~~~~ ./../include/libc-symbols.h:602:32: note: in expansion of macro ‘hidden_def’ 602 | # define libc_hidden_def(name) hidden_def (name) | ^~~~~~~~~~ errno-loc.c:28:1: note: in expansion of macro ‘libc_hidden_def’ 28 | libc_hidden_def (__errno_location) | ^~~~~~~~~~~~~~~ errno-loc.c:24:1: note: ‘__EI___errno_location’ target declared here 24 | __errno_location (void) | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [../o-iterator.mk:9: /opt/module/mysql-lib/glibc-2.28/build/csu/errno-loc.os] Error 1 make[2]: Leaving directory '/opt/module/mysql-lib/glibc-2.28/csu' make[1]: *** [Makefile:258: csu/subdir_lib] Error 2 make[1]: Leaving directory '/opt/module/mysql-lib/glibc-2.28' make: *** [Makefile:9: all] Error 2经过我又重装了gcc 8.2.0,这个问题终于消失了。
make install # 结果 LD_SO=ld-linux-x86-64.so.2 CC="gcc -B/usr/bin/" /usr/bin/perl scripts/test-installation.pl /opt/module/mysql-lib/glibc-2.28/build/ /usr/bin/ld: cannot find -lnss_test2 collect2: error: ld returned 1 exit status Execution of gcc -B/usr/bin/ failed! The script has found some problems with your installation! Please read the FAQ and the README file and check the following: - Did you change the gcc specs file (necessary after upgrading from Linux libc5)? - Are there any symbolic links of the form libXXX.so to old libraries? Links like libm.so -> libm.so.5 (where libm.so.5 is an old library) are wrong, libm.so should point to the newly installed glibc file - and there should be only one such link (check e.g. /lib and /usr/lib) You should restart this script from your build directory after you've fixed all problems! Btw. the script doesn't work if you're installing GNU libc not as your primary library! make[1]: *** [Makefile:111: install] Error 1 make[1]: Leaving directory '/opt/module/mysql-lib/glibc-2.28' make: *** [Makefile:12: install] Error 2 # 这上面的问题可以忽略 ls -l /lib64/libc.so.6 # 最后来看看我们的结果吧 strings /lib64/libc.so.6 | grep GLIBC GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_2.25 GLIBC_2.26 GLIBC_2.27 GLIBC_2.28 GLIBC_PRIVATEglibc升级成功。