/usr/local/mysql//bin/my_print_defaults: /lib64/libc.so.6: version `GLIBC_2.14' not found问题解决方案

时间:2022-02-26 15:30:50

安装mariadb过程中,提示“/usr/local/mysql//bin/my_print_defaults: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/mysql//bin/my_print_defaults)”问题处理:

1、参考http://blog.csdn.net/cpplang/article/details/8462768#comments下载并安装glibc_2.14。(xz文件要经两次解压,先解压xz,再解压tar)。

2、运行sudo make install命令安装glibc-2.14时,末尾信息提示ld.so.conf不存在,运行cp -r /etc/ld.so.c* /opt/glibc-2.14/etc/即可。

3、安装好后,若执行./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql还是报错,则先执行4。

4、执行ln -sf /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6。

执行4后,问题解决。


以下为部分记录:

一、解决前

[root@DB1 build]# cd /usr/local/mysql/

[root@DB1 mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql
/usr/local/mysql//bin/my_print_defaults: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/mysql//bin/my_print_defaults)
Neither host 'DB1' nor 'localhost' could be looked up with
'/usr/local/mysql//bin/resolveip'
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

二、解决后
The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
[root@DB1 mysql]# ln -sf /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6
[root@DB1 mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql
WARNING: The host 'DB1' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/data/mysql' ...
160723 14:11:19 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
160723 14:11:19 [Note] /usr/local/mysql//bin/mysqld (mysqld 5.5.50-MariaDB) starting as process 18624 ...

OK



===============================写在第二天================================

注意!!!升级glibc后,可能导致系统崩溃,此时,进入centos救援模式,在shell中还原版本即可:
升级时运行了以下命令:
ln -sf /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6
还原时运行以下命令:
ln -sf /lib64-2.12.so /lib64/libc.so.6


所以抱歉,问题还是没解决,计划下载源码包,自己编译成二进制包后再安装。