mysql客户端登录时报mysql: relocation error错误

在安装了xtrabackup后,再用下列命令登录时报下列错误

[root@localhost ~]# mysql -u root -p
mysql: relocation error: mysql: symbol strmov, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference

解决方法:

  1. 查看该库文件是否存在

    [root@localhost ~]# find / -name libmysqlclient.so.16
    /usr/lib64/libmysqlclient.so.16

  2. 查看mysql命令运行时所需要的库文件

    [root@localhost ~]# ldd /usr/bin/mysql
     linux-vdso.so.1 =>  (0x00007fffe3fff000)
     libncursesw.so.5 => /lib64/libncursesw.so.5 (0x00007f387380c000)
     libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f38735ee000)
     libmysqlclient.so.16 => /usr/lib64/libmysqlclient.so.16 (0x00007f387327f000)
     libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f3873048000)
     libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f3872e2e000)
     libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f3872bc2000)
     libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f38727df000)
     libz.so.1 => /lib64/libz.so.1 (0x00007f38725c8000)
     libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f38722c2000)
     libm.so.6 => /lib64/libm.so.6 (0x00007f387203e000)
     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3871e27000)
     libc.so.6 => /lib64/libc.so.6 (0x00007f3871a93000)
     libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f3871872000)
     libdl.so.2 => /lib64/libdl.so.2 (0x00007f387166d000)
     /lib64/ld-linux-x86-64.so.2 (0x00007f3873a4b000)
     librt.so.1 => /lib64/librt.so.1 (0x00007f3871465000)
     libfreebl3.so => /lib64/libfreebl3.so (0x00007f3871262000)
     libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f387101d000)
     libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f3870d37000)
     libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f3870b33000)
     libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f3870906000)
     libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f38706fb000)
     libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f38704f7000)
     libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f38702dd000)
     libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f38700be000)

    从上面可以看到该文件已存在,并且已被调用

3.查看系统中是否安装了Percona软件包

[root@localhost ~]# rpm -qa | grep Percona
Percona-Server-shared-51-5.1.73-rel14.12.624.rhel6.x86_64

 

4.将该软件包卸载掉

[root@localhost ~]# rpm -e Percona-Server-shared-51-5.1.73 --nodeps

 

5.禁用percona的软件源

[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Vault.repo  epel.repo  epel-testing.repo  percona-release.repo

[root@localhost yum.repos.d]# mv percona-release.repo percona-release.repo.disable

 

6.安装mysql-libs软件包

[root@localhost ~]# yum -y install mysql-libs
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.yun-idc.com
 * epel: mirrors.yun-idc.com
 * extras: mirrors.yun-idc.com
 * updates: mirrors.btte.net
Resolving Dependencies
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                Arch                               Version                                    Repository                        Size
=============================================================================================================================================================
Installing:
 mysql-libs                             x86_64                             5.1.73-3.el6_5                             base                             1.2 M

Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)

Total download size: 1.2 M
Installed size: 4.0 M
Downloading Packages:
mysql-libs-5.1.73-3.el6_5.x86_64.rpm                                                                                                  | 1.2 MB     00:07    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 16 pre-existing rpmdb problem(s), ‘yum check‘ output follows:
mysql-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
mysql-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
mysql-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient_r.so.16()(64bit)
mysql-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient_r.so.16(libmysqlclient_16)(64bit)
mysql-5.1.73-3.el6_5.x86_64 has missing requires of mysql-libs = (‘0‘, ‘5.1.73‘, ‘3.el6_5‘)
mysql-devel-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
mysql-devel-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient_r.so.16()(64bit)
mysql-server-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
mysql-server-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
mysql-server-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient_r.so.16()(64bit)
mysql-server-5.1.73-3.el6_5.x86_64 has missing requires of libmysqlclient_r.so.16(libmysqlclient_16)(64bit)
perl-DBD-MySQL-4.013-3.el6.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
perl-DBD-MySQL-4.013-3.el6.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)
2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of mysql-libs
  Installing : mysql-libs-5.1.73-3.el6_5.x86_64                                                                                                          1/1
  Verifying  : mysql-libs-5.1.73-3.el6_5.x86_64                                                                                                          1/1

Installed:
  mysql-libs.x86_64 0:5.1.73-3.el6_5                                                                                                                        

Complete!

7.重新登录进行测试

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> exit

 

问题解决!

本文出自 “云人生” 博客,请务必保留此出处http://ovcer.blog.51cto.com/1145188/1620051

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。