mysql用戶端登入時報mysql: relocation error錯誤

來源:互聯網
上載者:User

標籤:libmysqlclient_16

在安裝了xtrabackup後,再用下列命令登入時報下列錯誤

[[email protected] ~]# 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. 查看該庫檔案是否存在

    [[email protected] ~]# find / -name libmysqlclient.so.16
    /usr/lib64/libmysqlclient.so.16

  2. 查看mysql命令運行時所需要的庫檔案

    [[email protected] ~]# 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軟體包

[[email protected] ~]# rpm -qa | grep Percona
Percona-Server-shared-51-5.1.73-rel14.12.624.rhel6.x86_64

 

4.將該軟體包卸載掉

[[email protected] ~]# rpm -e Percona-Server-shared-51-5.1.73 --nodeps

 

5.禁用percona的軟體源

[[email protected] ~]# cd /etc/yum.repos.d
[[email protected] 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

[[email protected] yum.repos.d]# mv percona-release.repo percona-release.repo.disable

 

6.安裝mysql-libs軟體包

[[email protected] ~]# 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.重新登入進行測試

[[email protected] ~]# 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

mysql用戶端登入時報mysql: relocation error錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.