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

在安装了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

问题解决!

时间: 2024-10-31 17:07:50

mysql客户端登录时报mysql: relocation error错误的相关文章

mysql客户端工具及mysql客户端命令和mysqladmin的使用

mysql客户端工具 常用的mysql客户端工具有这些: mysql:这是一个命令行的客户端工具,在安装mysql服务器时,会自动安装的一个命令行工具. mysqldump:这是用来备份mysql时用到的客户端工具 mysqladmin:这是一个比较常用的mysql客户端管理工具,功能比较强大,后文会介绍 mysqlcheck mysqlimport mysql命令:mysql客户端命令和服务器端命令 在使用账号和密码登入到mysql服务器上时,即出现"mysql>"字样是,表示

MySql客户端远程连接MySql服务器

设置MySql服务器以接听端口及以绑定IP地址 MySql服务器默认监听3306端口,确定防火墙以开放此端口. 编辑/etc/my.cnf 添加绑定IP地址.bind-address=192.168.42.135 重启MySql服务器,查看监听状态. [[email protected] ~]$ netstat -lnt Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Add

记32位Oracle客户端登录报12560协议适配器错误的解决办法

国庆买了一台新电脑ThinkPad E431,i5双核CPU,8G内存,硬盘比较坑爹5400转的500G,重点是预装win8的64位简体中文版.大学时买了第一台电脑神舟笔记本,因为神舟电脑便宜,所以没有预装正版系统:工作了以后给老婆买了一台电脑惠普笔记本,当时一个朋友开店做惠普电脑代理,为了帮他开个张,就从他那里买的,他给装了个盗版winxp.其实心里还是很支持正版windows操作系统的,而且新公司给发的工作电脑又很破,严重影响工作心情,所以就买了联想的ThinkPad,于是乎就有了正版win

php 图片上传 500 Internal Server Error 错误

写php简单上传图片时,发现200k的图片上传时报Internal Server Error错误,检查了 upload_max_filesize,及其他post_max_size.max_input_time.memory_limit. max_execution_time配置项均没有问题,后检查错误日 志:mod_fcgid: HTTP request length 138296 (so far) exceeds MaxRequestLen (131072), 发现问题所在. 原 来是fast

Web项目打成war包部署到tomcat时报MySQL Access denied for user 'root'@'localhost' (using password: YES)错误解决方案

Web项目使用使用root账号root密码进行部署,通过Eclipse加载到Tomcat服务器可以发布成功,打成war包放到tomcat的webapps目录无法发布成功,报错: jdbc.properties涉及Mysql配置: 错误很明显,与MySQL密码有关,但是两种方式部署项目使用的jdbc.properties配置文件是一样的.所以肯定不是密码不对引起的,只好找度娘,O(∩_∩)O哈哈~. 网上大部分帖通过运行mysql -u root -p命令登录时也会报这个错误,所以,我就尝试这种方

fedota 20编译php checking for mysql_set_server_option in -lmysqlclient... no configure: error: wrong mysql library version or lib not found. 错误

php-5.5.15 + mysql-5.5.27,编译php的时候报错,checking for mysql_set_server_option in -lmysqlclient... no configure: error: wrong mysql library version or lib not found. Check config.log for more information. 解决方法重新编译mysql,并把-DENABLE_DTRACE=0这项加进mysql的编译cmake

mysql远程登录错误修正

远程登录Linux服务器上面的mysql,出现了两个小错误: 1:10060错误->服务器防火墙开启状态 setup->关闭防火墙(有时候可能找不到相关的设置项,需要安装相关的管理软件) 2:Host is not allowed to connect to this MySQL server 这个错误是MySQL不允许远程登录造成的 严格来说是登录的MySQL账户不不允许远程登录 解决办法: 1.在装有MySQL的机器上面登录MySQL : mysql -uroot -p  (可以用putt

客户端不能连接MySQL - 2003-Can't connect to MySQL server on '192.168.43.180'(10060 "Unknown error")

客户端不能连接MySQL 场景: 数据库(此处以MySQL为例)安装在虚拟机里面,在宿主机上进行连接数据库的时候始终不能连接,但在虚拟机中使用正常. 针对上面的场景: 1. 在虚拟机里面可以正常使用MySQL 2. 在宿主机上进行连接的时候,始终不能连接 解决方案: 第一步:检查账号是否支持远程链接? 相关操作指令: # mysql -uroot -p  使用root用户链接mysql # show databases             查看已有的数据框(主要是为了找:mysql 这个数据

mysql的创创建用户阶段 开启客户端登录和授权阶段

创建一个权限有限的用户给别人使用 # 创建用户阶段 # mysql> create user 'yuan'@'localhost'; # mysql> create user 'alex'@'localhost' identified by '123'; # mysql> create user 'alex'@'192.168.11.22' identified by '123'; # mysql> create user 'alex'@'192.168.11.%' identif