设为首页 收藏本站
查看: 952|回复: 0

[经验分享] mysql客户端登录时报mysql: relocation error错误

[复制链接]

尚未签到

发表于 2018-9-29 09:43:43 | 显示全部楼层 |阅读模式
  在安装了xtrabackup后,再用下列命令登录时报下列错误
  [root@localhost ~]# mysql -u root -p

  mysql:>  解决方法:

  •   查看该库文件是否存在
      [root@localhost ~]# find / -name libmysqlclient.so.16
      /usr/lib64/libmysqlclient.so.16
  •   查看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                       >  =============================================================================================================================================================
  Installing:
  mysql-libs                             x86_64                             5.1.73-3.el6_5                             base                             1.2 M
  Transaction Summary
  =============================================================================================================================================================
  Install       1 Package(s)

  Total download>
  Installed>  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>  ** 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>  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
  问题解决!


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-603603-1-1.html 上篇帖子: mysql常用操作命令, mysql脚本优化工具使用说明 下篇帖子: 检查和修复mysql表:mysql table is marked as crashed and last (automatic?) repair failed
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表