1. 程式人生 > >sysbench安裝(CentOS5.8\MySQL5.6\sysbench-0.4.12)

sysbench安裝(CentOS5.8\MySQL5.6\sysbench-0.4.12)

Ø  下載安裝包sysbench-0.4.12.tar.gz

Ø  解壓並進入目錄

tar xzvf sysbench-0.4.12.tar.gz
cd sysbench-0.4.12

Ø  配置

./configure

Invalid configuration `x86_64-unknown-linux-':machine `x86_64-unknown-linux' not recognized

configure: error: /bin/sh config/config.subx86_64-unknown-linux- failed

Ø  重新配置

./configure --build=x86_64

configure: error: no acceptable C compiler foundin $PATH

Ø  安裝C/C++編譯器

sudo yum install gcc-c++

Ø  重新配置

./configure --build=x86_64

configure: error: mysql_config executable notfound

*******************************************************************************

ERROR: cannot find MySQL libraries. If you wantto compile with MySQL support,

       youmust either specify file locations explicitly using

      --with-mysql-includes and --with-mysql-libs options, or make sure pathto

      mysql_config is listed in your PATH environment variable. If you want to

      disable MySQL support, use --without-mysql option.

*******************************************************************************

Ø  安裝MySQL標頭檔案和庫檔案

sudo yum install MySQL-shared
sudo yum install MySQL-devel

Ø  重新配置

./configure

Ø  編譯

sudo make
../libtool: line 838: X--tag=CC: command notfound

../libtool: line 871: libtool: ignoring unknowntag : command not found

../libtool: line 838: X--mode=link: command notfound

……

Ø  升級libtool

sudo yum install libtool

之後用新的libtoll替換sysbench目錄中舊的libtool後重新編譯

或者直接在sysbench目錄下執行autogen.sh自動在該目錄安裝新的libtool

Ø  重新配置

sudo make clean
./configure

Ø  編譯安裝

make
sudo make install
**************************** 正常情況下,進入解壓目錄,依次執行
./autogen.sh
./configure
make
sudo make install

或者
tar xzvf  sysbench-0.4.12.tar.gz
cd sysbench-0.4.12
sudo yum install gcc-c++ 
sudo yum install MySQL-shared
sudo yum install MySQL-devel
./configure
sudo yum install libtool(之後替換掉sysbench目錄內的libtool)
make
sudo make install