1.我的linux系统的情况,没有连互联网
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)
[root@localhost ~]# uname -r
2.6.32-642.el6.x86_64
2.我的目的是想在redhat6.8安装MySQL5.7,然后我下载MySQL的rpm安装包,如下:
[root@localhost ~]# ls mysql-community-*
mysql-community-client-5.7.17-1.el7.x86_64.rpm
mysql-community-common-5.7.17-1.el7.x86_64.rpm
mysql-community-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-5.7.17-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
mysql-community-server-5.7.17-1.el7.x86_64.rpm
mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm
mysql-community-test-5.7.17-1.el7.x86_64.rpm
3.linux用yum安装gcc、cmake
4.rpm安装mysql:[root@localhost ~]#rpm -Uvh mysql-community*
结果报错:
error: Failed dependencies:
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-client-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-client-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-embedded-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-embedded-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-embedded-compat-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.17)(64bit) is needed by mysql-community-embedded-compat-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-embedded-compat-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-libs-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-libs-compat-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.17)(64bit) is needed by mysql-community-libs-compat-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.16)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.17)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-server-5.7.17-1.el7.x86_64
systemd is needed by mysql-community-server-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-server-minimal-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by mysql-community-server-minimal-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.16)(64bit) is needed by mysql-community-server-minimal-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.17)(64bit) is needed by mysql-community-server-minimal-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-server-minimal-5.7.17-1.el7.x86_64
libc.so.6(GLIBC_2.14)(64bit) is needed by mysql-community-test-5.7.17-1.el7.x86_64
libstdc++.so.6(GLIBCXX_3.4.15)(64bit) is needed by mysql-community-test-5.7.17-1.el7.x86_64
perl(JSON) is needed by mysql-community-test-5.7.17-1.el7.x86_64
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_7.1.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-
6.el6_7.1.x86_64
上网查询之后,我们需要安装以下东西:Glibc-2.14、2.15、2.16、2.17,GLIBCXX_3.4.15, perl(JSON) ,
5.首先,按照网上的办法,先升级安装glibc
5.1 查看已经安装的glibc的版本
[root@localhost ~]# strings /lib64/libc.so.6 | grep GLIBC
5.2 下载glibc-2.17的版本,解压后安装,下载地址:http://ftp.gnu.org/gnu/glibc/
[root@localhost glibc-2.17]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
configure: error: you must configure in a separate build directory
5.3 在glibc-2.17的目录中直接执行./configure报错,上网查看,不能再当前目录执行configure
[root@localhost ~]# glibc/glibc-2.17/configure --prefix=/usr/local/glibc_2.17
然后执行成功,继续执行[root@localhost ~]# make && make install 执行成功
5.4 但是安装之后,查看glibc的版本,还是原来的版本,按照网上的说法,/lib64/libc.so.6需要建立一个新的连接
[root@localhost ~]# /lib64/libc.so.6
GNU C Library stable release version 2.12, by Roland McGrath et al.
Copyright (C) 2010 Free Software Foundation, Inc.
然后把建一个连接
[root@localhost ~]# rm -rf libc.so.6
[root@localhost ~]# ln -s /usr/local/glibc_2.17/lib/libc-2.17.so /lib64/libc.so.6
5.5 但是,建立连接后,命令又不能用了,出现如下报错:
error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or di
然后我又把原来的库连接回去:
[root@localhost ~]# LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6
5.6 然后,按照网上的办法,用LD_PRELOAD把新的目录指向到安装目录
[root@localhost ~]# rm -rf libc.so.6
[root@localhost ~]# LD_PRELOAD=/usr/local/glibc_2.17/lib/libc-2.17.so ln -s
/usr/local/glibc_2.17/lib/libc-2.17.so /lib64/libc.so.6
然后,还是报错:
ln: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
还是用这个挽救回来:LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6
5.7 然后,网上的办法:export LD_LIBRARY_PATH=/usr/local/glibc_2.17/lib:$LD_LIBRARY_PATH
结果还是不行,用unset LD_LIBRARY_PATH 挽救回来
5.8 然后,查找资料之后,glibc的安装之后需要 命令make localedata/install-locales更新时间数据库:但是执行之后,
重新链接,还是报错:
ln: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
6.请问这是怎么回事?我应该怎么做?