HammerDB验证环境变量报错的解决方法

如果报错的信息同下面的 1 一样,那么就按照 1 的方法解决,下面 1 这个方法是搜索到的普遍的解决方法,如果不是报错的libmysqlclient.so.18而是libmysqlclient.so.21,那么就看 2

1.验证环境变量:

[root@master /usr/local/HammerDB-2.23]# ./bin/tclsh8.6
% package require mysqltcl
couldn't load file "/usr/local/HammerDB-2.23/lib/mysqltcl-3.052/libmysqltcl3.052.so": /usr/lib64/libmysqlclient.so.18: version `libmysqlclient_18' not found (required by /usr/local/HammerDB-2.23/lib/mysqltcl-3.052/libmysqltcl3.052.so)
此时,我们把sysbench 1.0中percona的那个依赖包软链去掉,就可以了
[root@master /root]#locate libmysqlclient.so.18
/home/mysql/program/mysql-5.6.34-linux-glibc2.5-x86_64/lib/libmysqlclient.so.18
/home/mysql/program/mysql-5.6.34-linux-glibc2.5-x86_64/lib/libmysqlclient.so.18.1.0
/home/woqu/qdata-dev-env/mysql5.5.25a/lib/libmysqlclient.so.18
/home/woqu/qdata-dev-env/mysql5.5.25a/lib/libmysqlclient.so.18.0.0
/usr/lib64/libmysqlclient.so.18

[root@master /root]# ll /usr/lib64/libmysqlclient.so.18
lrwxrwxrwx 1 root 22 Nov  1 11:56 /usr/lib64/libmysqlclient.so.18 -> libmysqlclient_r.so.16

[root@master /root]# unlink /usr/lib64/libmysqlclient.so.18
[root@master /root]# ln -s /home/mysql/program/mysql-5.6.34-linux-glibc2.5-x86_64/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
如果需要使用sysbench 1.0时,重新换一下软链即可,当然,由于这里我们是使用的MySQL 5.6.x的lib库,两者都可以使用,无需换软连接

2.验证环境变量:

[root@iZ8vb409m8717wao0dkpb4Z HammerDB-3.3]# ./bin/tclsh8.6 		#报错
% package require mysqltcl
couldn't load file "/usr/local/HammerDB-3.3/lib/mysqltcl-3.052/libmysqltcl3.052.so": libmysqlclient.so.21: cannot open shared object file: No such file or directory
% exit

HammerDB3.3版本需要libmysqlclient.so.21这个库,解决上面的报错方法是安装mysql8.0的客户端程序。

[root@iZ8vb409m8717wao0dkpb4Z www]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
[root@iZ8vb409m8717wao0dkpb4Z www]# yum install mysql-community-client

这样在/usr/lib64/mysql目录下就会有需要的库文件了:

[root@iZ8vb409m8717wao0dkpb4Z www]# ll /usr/lib64/mysql/libmysql*
-rw-r--r-- 1 root root 57913972 Mar 26 22:18 /usr/lib64/mysql/libmysqlclient.a
lrwxrwxrwx 1 root root       20 Jun 24 16:45 /usr/lib64/mysql/libmysqlclient_r.so.18 -> libmysqlclient.so.18
lrwxrwxrwx 1 root root       24 Jun 24 16:45 /usr/lib64/mysql/libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0
lrwxrwxrwx 1 root root       20 Jun 24 16:45 /usr/lib64/mysql/libmysqlclient.so -> libmysqlclient.so.21
lrwxrwxrwx 1 root root       24 Jun 24 16:45 /usr/lib64/mysql/libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x 1 root root  5983896 Mar 26 22:04 /usr/lib64/mysql/libmysqlclient.so.18.1.0
lrwxrwxrwx 1 root root       25 Jun 24 16:45 /usr/lib64/mysql/libmysqlclient.so.21 -> libmysqlclient.so.21.1.20
-rwxr-xr-x 1 root root 22144416 Mar 26 22:18 /usr/lib64/mysql/libmysqlclient.so.21.1.20
-rw-r--r-- 1 root root    48398 Mar 26 22:16 /usr/lib64/mysql/libmysqlservices.a
再次验证环境变量:
[root@iZ8vb409m8717wao0dkpb4Z HammerDB-3.3]# ./bin/tclsh8.6 
% package require mysqltcl
3.052
% exit
没有报错就说明环境变量验证通过。

你可能感兴趣的:(MySQL,mysql,数据库,redis,mongodb)