sysbench的安装及使用

一、安装

我的安装过程去官网上面下载下源码,然后安装。

系统:CentOS release 5.3

安装过程首先运行autogen.sh

然后通过locate mysql找到mysql的include和lib的位置

 ./configure --prefix=/usr/sysbench --with-mysql-includes=/usr/include/mysql/  --with-mysql-libs=/usr/lib64/mysql/

make

make install

二、使用

在使用之前必须创建好数据库,可以创建成默认的sbtest,然后就不用指定该参数了,下面是官方文档中关于这个参数的说明:

--mysql-db MySQL database name. Note SysBench will not automatically create this database. You should create it manually and grant the appropriate privileges to a user which will be used to access the test table. sbtest

假如没有创建的话,sysbench会报错,提示:

FATAL: unable to connect to MySQL server, aborting...
FATAL: error 1049: Unknown database 'sbtest'
FATAL: failed to connect to database server!

害我检查了半天,以为是用户名和密码的问题

 

具体使用以及参数可以参照下面的文章:

http://www.ningoo.net/html/2009/performance_test_tool_sysbench.html

官方文档

 

下面是我的prepare过程

/usr/sysbench/bin/sysbench --debug=off --test=oltp --mysql-table-engine=innodb --oltp-table-size=2000000 --mysql-socket=/data/mysql/ha_master/mysql.sock --num-threads=8 --max-requests=0 --mysql-user=root --mysql-password=*** --mysql-host=localhost prepare

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值