安装:
./configure --prefix=/data/sysbench --with-mysql-includes=/usr/local/mysql/include/mysql --with-mysql-libs=/usr/local/mysql/lib/mysql && make && make install
问题:
1.如果mysql不是默认路劲安装的需要加参数
--with-mysql-includes
--with-mysql-libs
./configure --prefix=/data/sysbench --with-mysql-includes=/usr/local/mysql/include/mysql --with-mysql-libs=/usr/local/mysql/lib/mysql make && make install
2.编译安装前先yum install gcc 和 yum install libtool 以及 yum install automake
3.如果出现大量以下错误:
../libtool: line 838: X–tag=CC: command not found
./autogen.sh && ./configure && make && make install
解决办法很简单。到sysbench解压后的目录下执行autogen.sh即可
4.如果出现../libtool: line 763: X–tag=CC: command not found
执行 export echo=echo 然后再make
5.设置libmysqlclient的软链,防止编译其它依赖Mysql软件时出现libmysqlclient.so.18: cannot open shared object file 的错误
32位系统下的MYSQL客户端软链接
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18
64位系统下的MYSQL客户端软链接
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
6.如果出现下面的报错
sysbench/tests/cpu/Makefile.am:17: The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'
sysbench/tests/cpu/Makefile.am:17: to `configure.ac' and run `autoconf' again.
sysbench/tests/fileio/Makefile.am:17: library used but `RANLIB' is undefined
vi configure.ac 找到 Checks for programs 然后按下面的参数配置
# Checks for programs.
AC_PROG_CC
#AC_PROG_LIBTOOL
AC_PROG_RANLIB
AX_CHECK_DOCBOOK