sysbench: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
Posted on 2022-09-22 18:31 高&玉 阅读(946) 评论(0) 编辑 收藏 举报背景
我的环境有MySQL、PostgreSQL数据库,为了压测方便我安装了sysbench
[root]# yum install autoconf automake libtool -y
[root]# git clone https://github.com/akopytov/sysbench.git
[root]# cd sysbench
[root]# sh autogen.sh
[root]# ./configure --with-pgsql --with-pgsql-includes=/usr/local/postgresql/include --with-pgsql-libs=/usr/local/postgresql/lib
[root]# make && make install
查看sysbench版本报错
[root]# sysbench --help
sysbench: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
解决办法
将PostgreSQL的lib路径加到环境变量中
[root]# echo "export LD_LIBRARY_PATH=/usr/local/postgresql/lib" >> /etc/profile
[root]# source /etc/profile
再次查看sysbench版本
[root@host71 etc]# sysbench --version
sysbench 1.1.0