1,环境要求:
1,centos,gcc,gcc++
如果没有安装gcc:错误提示:
configure: error: no acceptable C compiler found in $PATH,
yum -y install gcc
yum -y install gcc-c++
yum install make
2,如果没有安装libtool,make的时候 会报如下错误:
./libtool: line 841: X--tag=CC: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 2234: X-g: command not found
../libtool: line 2234: X-O2: command not found
../libtool: line 1954: X-L/usr/local/mysql/lib: No such file or directory
../libtool: line 2403: Xsysbench: command not found
yum install libtool 然后执行:cp /usr/bin/libtool /usr/local/sysbench-0.4.12/libtool
3,没有安装make :command make not found
yum install make
4,安装:
./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
5,make && make install
6,sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
cd /usr/local/mysql/lib 查看是否有libmysqlclient.so.18
cd /usr/lib/ 查看是否有libmysqlclient.so.18
/usr/lib/ 中没有libmysqlclient.so.18 则做软链接
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib
执行:sysbench -V 安装成功