1.解压
unzip sysbench-1.0.zip
mv sysbench-1.0 /opt/
2.执行脚本
[root@localhost sysbench-1.0]# ./autogen.sh
3.编译
./configure --prefix=/usr/local/sysbencd_1.0 --with-mysql-includes=/opt/mysql5730/include --with-mysql-libs=/opt/mysql5730/lib
make && make install
4.使用
/opt/mysql5730/bin/mysql -h localhost -uroot -pmysql
/usr/local/sysbencd_1.0/bin/sysbench --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password='mysql' --test=/opt/sysbench-1.0/tests/include/oltp_legacy/oltp.lua --oltp_tables_count=10 --oltp-table-size=1000 --rand-init=on prepare
/usr/local/sysbencd_1.0/bin/sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
解决办法:
加入环境变量
LD_LIBRARY_PATH=/opt/mysql5730/lib:/opt/