sysbench下载安装
涉及到sysbench源码的配置和编译,首先确认系统安装了gcc gcc-c++编译器;
确认安装了autoconf 、automake、libtool等;
[root@PC download]# rpm -qa | grep automake
[root@PC download]# rpm -qa | grep autoconf
[root@PC download]# rpm -qa | grep libtool
必须安装MySQL-devel;
否则后面make intall的时候会报错:/usr/bin/ld: cannot find -lmysqlclient_r。
yum install mysql-devel -y
--开始安装sysbench,点击这里下载:
tar xzvf sysbench-0.5.tar.gz
cd sysbench-0.5
chmod +x autogen.sh
./autogen.sh
./configure --with-mysql --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/lib64/mysql
make
make install
确保make,make install无误才行。
注意:
./configure --with-mysql --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/lib64/mysql 这两个目录根据实际系统情况指定。
不确定的话,可以查找一下:
[root@PC local]# find / -name mysql
--假如make时报错:
- drv_mysql.c:36:19: error: mysql.h: No such file or directory
- drv_mysql.c:37:26: error: mysqld_error.h: No such file or directory
- drv_mysql.c:43:5: warning: "MYSQL_VERSION_ID" is not defined
- drv_mysql.c:48:5: warning: "MYSQL_VERSION_ID" is not defined
- drv_mysql.c: In function ‘mysql_drv_init’:
- drv_mysql.c:240: warning: implicit declaration of function ‘mysql_library_init’
- drv_mysql.c:240: warning: nested extern declaration of ‘mysql_library_init’
- drv_mysql.c: In function ‘mysql_drv_connect’:
- drv_mysql.c:262: error: ‘MYSQL’ undeclared (first use in this function)
- drv_mysql.c:262: error: (Each undeclared identifier is reported only once
- drv_mysql.c:262: error: for each function it appears in.)
- drv_mysql.c:262: error: ‘con’ undeclared (first use in this function)
- drv_mysql.c:268: error: expected expression before ‘)’ token
- drv_mysql.c:274: warning: implicit declaration of function ‘mysql_init’
- drv_mysql.c:274: warning: nested extern declaration of ‘mysql_init’
- drv_mysql.c:300: warning: implicit declaration of function ‘mysql_ssl_set’
- drv_mysql.c:300: warning: nested extern declaration of ‘mysql_ssl_set’
- drv_mysql.c:303: error: ‘MYSQL_VERSION_ID’ undeclared (first use in this function)
- drv_mysql.c:313: warning: implicit declaration of function ‘mysql_real_connect’
- drv_mysql.c:313: warning: nested extern declaration of ‘mysql_real_connect’
- drv_mysql.c:320:5: warning: "MYSQL_VERSION_ID" is not defined
- drv_mysql.c:328: warning: implicit declaration of function ‘mysql_errno’
- drv_mysql.c:328: warning: nested extern declaration of ‘mysql_errno’
- drv_mysql.c:329: warning: implicit declaration of function ‘mysql_error’
- drv_mysql.c:329: warning: nested extern declaration of ‘mysql_error’
- drv_mysql.c: In function ‘mysql_drv_disconnect’:
- drv_mysql.c:343: error: ‘MYSQL’ undeclared (first use in this function)
- drv_mysql.c:343: error: ‘con’ undeclared (first use in this function)
- drv_mysql.c:348: warning: implicit declaration of function ‘mysql_close’
- drv_mysql.c:348: warning: nested extern declaration of ‘mysql_close’
- drv_mysql.c: In function ‘mysql_drv_bind_param’:
- drv_mysql.c:423: error: ‘MYSQL’ undeclared (first use in this function)
- drv_mysql.c:423: error: ‘con’ undeclared (first use in this function)
- drv_mysql.c:423: error: expected expression before ‘)’ token
- drv_mysql.c: In function ‘mysql_drv_query’:
- drv_mysql.c:639: error: ‘MYSQL’ undeclared (first use in this function)
- drv_mysql.c:639: error: ‘con’ undeclared (first use in this function)
- drv_mysql.c:643: warning: implicit declaration of function ‘mysql_real_query’
- drv_mysql.c:643: warning: nested extern declaration of ‘mysql_real_query’
- drv_mysql.c:649: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
- drv_mysql.c:649: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
- drv_mysql.c:650: error: ‘ER_CHECKREAD’ undeclared (first use in this function)
- drv_mysql.c: In function ‘mysql_drv_fetch_row’:
- drv_mysql.c:678: warning: implicit declaration of function ‘mysql_fetch_row’
- drv_mysql.c:678: warning: nested extern declaration of ‘mysql_fetch_row’
- drv_mysql.c:678: warning: assignment makes pointer from integer without a cast
- drv_mysql.c: In function ‘mysql_drv_store_results’:
- drv_mysql.c:705: error: ‘MYSQL’ undeclared (first use in this function)
- drv_mysql.c:705: error: ‘con’ undeclared (first use in this function)
- drv_mysql.c:706: error: ‘MYSQL_RES’ undeclared (first use in this function)
- drv_mysql.c:706: error: ‘res’ undeclared (first use in this function)
- drv_mysql.c:707: error: ‘MYSQL_ROW’ undeclared (first use in this function)
- drv_mysql.c:707: error: expected ‘;’ before ‘row’
- drv_mysql.c:751: warning: implicit declaration of function ‘mysql_store_result’
- drv_mysql.c:751: warning: nested extern declaration of ‘mysql_store_result’
- drv_mysql.c:757: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
- drv_mysql.c:757: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
- drv_mysql.c:758: error: ‘ER_CHECKREAD’ undeclared (first use in this function)
- drv_mysql.c:765: warning: implicit declaration of function ‘mysql_field_count’
- drv_mysql.c:765: warning: nested extern declaration of ‘mysql_field_count’
- drv_mysql.c:772: warning: implicit declaration of function ‘mysql_num_rows’
- drv_mysql.c:772: warning: nested extern declaration of ‘mysql_num_rows’
- drv_mysql.c:776: error: ‘row’ undeclared (first use in this function)
- drv_mysql.c: In function ‘mysql_drv_free_results’:
- drv_mysql.c:799: warning: implicit declaration of function ‘mysql_free_result’
- drv_mysql.c:799: warning: nested extern declaration of ‘mysql_free_result’
- drv_mysql.c:799: error: ‘MYSQL_RES’ undeclared (first use in this function)
- drv_mysql.c:799: error: expected expression before ‘)’ token
请检查下--with-mysql-includes=/usr/local/mysql/include该路径是否配置正确。如,最上方报错:drv_mysql.c:36:19: error: mysql.h: No such file or directory
查找一下mysql.h是否在某个Include目录下存在。
安装完成后,检查该工具是否可以使用:
[root@PC local]# sysbench --help
- Missing required command argument.
- Usage:
- sysbench [general-options]... --test=<test-name> [test-options]... command
- General options:
- --num-threads=N number of threads to use [1]
- --max-requests=N limit for total number of requests [10000]
- --max-time=N limit for total execution time in seconds [0]
- --forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
- --thread-stack-size=SIZE size of stack per thread [64K]
- --tx-rate=N target transaction rate (tps) [0]
- --tx-jitter=N target transaction variation, in microseconds [0]
- --report-interval=N periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
- --test=STRING test to run
- --debug=[on|off] print more debugging info [off]
- --validate=[on|off] perform validation checks where possible [off]
- --help=[on|off] print help and exit
- --version=[on|off] print version and exit [off]
- --rand-init=[on|off] initialize random number generator [off]
- --rand-type=STRING random numbers distribution {uniform,gaussian,special} [special]
- --rand-spec-iter=N number of iterations used for numbers generation [12]
- --rand-spec-pct=N percentage of values to be treated as 'special' (for special distribution) [1]
- --rand-spec-res=N percentage of 'special' values to use (for special distribution) [75]
- --rand-seed=N seed for random number generator, ignored when 0 [0]
- Log options:
- --verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3]
- --percentile=N percentile rank of query response times to count [95]
- Compiled-in tests:
- fileio - File I/O test
- cpu - CPU performance test
- memory - Memory functions speed test
- threads - Threads subsystem performance test
- mutex - Mutex performance test
- Commands: prepare run cleanup help version
- See 'sysbench --test=<name> help' for a list of options for each test.
假如找不到sysbench命令,有可能make,make install的时候就报错了。请返回查看,解决报错问题后,重新编译。
--本篇文章参考自:http://www.linuxidc.com/Linux/2014-02/97107p2.htmsysbench下载安装
http://blog.csdn.net/yabingshi_tech/article/details/53113199
sysbench下载安装的更多相关文章
- CentOS6.6系统源代码安装mysql5.5.28教程(附源码包下载地址)+sysbench的安装
mysql从5.5版本开始,不再使用./configure编译,而是使用cmake编译器,具体的cmake编译参数可以参考mysql官网文档(※ 非常重要) http://dev.mysql.com/ ...
- sysbench下载与安装
目标:下载.安装sysbench软件,做数据库压测 准备: 在sysbench启动的linux机器上,首先安装好mysql,查看mysql已经启动 例如,在机器上已经安装完mysql,其路径为 /us ...
- sysbench工具安装使用
一.sysbench简介 Sysbench是一款开源的.跨平台的.模块化的.多线程的性能测试工具,通过高负载地运行在数据库上,可以执行CPU.内存.线程.IO.数据库等方面的性能测试.用于评估操作系统 ...
- sysbench的安装和做性能测试
sysbench的安装和做性能测试 http://imysql.cn/node/312 sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况. ...
- 安装特定版本 sysbench 以及安装时指定特定的mysql客户端
step1: 下载安装源码 https://github.com/akopytov/sysbench (git clone https://github.com/akopytov/sysbench.g ...
- sysbench的安装详解
sysbench是一个压力测试工具.可以用它来测试cpu.mem.disk.thread.mysql.postgr.oracle:然而作为一个mysql dba 我当然是用它来压测mysql啦! 一. ...
- 【转帖】sysbench的安装和做性能测试
iMySQL | 老叶茶馆 sysbench的安装和做性能测试 http://imysql.cn/node/312 我仿照这个学的 但是 需要用更新的版本才可以. By yejr on 14 六月 ...
- Visual Studio for Mac Preview离线下载安装
Visual Studio for Mac离线下载安装. 环境:OS X EI Caption 10.11.2 .NET Core SDK 1.1 需预先安装 .NET Core 1.1 SDK ma ...
- jdk1.8下载安装
jdk8环境变量 jdk8图解安装 java8安装 1 2 3 4 5 6 7 分步阅读 JDK8 是JDK的最新版本,加入了很多新特性,如果我们要使用,需要下载安装: JDK8在windows ...
随机推荐
- YTU 2558: 游起来吧!超妹!
2558: 游起来吧!超妹! 时间限制: 1 Sec 内存限制: 128 MB 提交: 70 解决: 22 题目描述 夏天到了,无聊的超妹跑到了落雪湖里抓鱼吃.结果,游到湖的正中 央时被湖边保安看 ...
- Silverlight数据绑定之DataGrid
Silverlight数据绑定之DataGrid 时间:2011-08-03 01:59来源:网易博客 作者:Wilson. 点击:次 注:所有代码以C#为例 DataGrid绑定的数据对象: 1.D ...
- codeforces 688A A. Opponents(水题)
题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- 并不对劲的p3676:小清新数据结构题
题目大意 有一棵有\(n\)(\(n\leq 2*10^5\))个点的树,要进行\(q\)(\(q\leq 2*10^5\))次操作,每次操作是以下两种中的一种: 1.修改一个点的点权 2.指定一个点 ...
- bzoj 1007: [HNOI2008]水平可见直线【半平面交】
其实并不算标准半平面交?但是思路差不多 先按照斜率排序,然后用栈维护凸壳,每遇到重斜率或a[i],s[top-1]交点的x轴在s[top],s[top-1]交点左侧,则说明s[top]被a[i],s[ ...
- XML(php中获取xml文件的方式/ajax获取xml格式的响应数据的方式)
1.XML 格式规范: ① 必须有一个根元素 ② 不可有空格.不可以数字或.开头.大小写敏感 ③ 不可交叉嵌套 ④ 属性双引号(浏览器自动修正成双引号了) ⑤ 特殊符号要使用实体 ⑥ 注释和HTML一 ...
- mac下安装ngnix以及开启关闭重启
一.安装 执行如下命令 brew search nginx brew install nginx 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/etc/nginx/ngi ...
- 关于数学函数中的abs——————————————杭电2057——————————————————————————
数学函数中的abs当你用abs之后括号之中的数字就转换成了int格式.可能会丢失一些数据造成误差而且还会有, 警告: #include<stdio.h> #include<ma ...
- 笔记——malloc、free、不同数据类型操作、.pyc文件、python安装第三方包、验证一个网站的所有链接有效性
C — malloc( ) and free( ) C 语言中使用malloc( )函数申请的内存空间,为什么一定要使用free释放? **malloc()函数功能:是从堆区申请一段连续的空间,函数结 ...
- 数据结构 - 顺序队列的实行(C语言)
数据结构-顺序队列的实现 1 顺序队列的定义 线性表有顺序存储和链式存储,队列作为一种特殊的线性表,也同样存在这两种存储方式.我们先来看队列的顺序存储结构. 队列的顺序储存结构:用数组存储队列,为了避 ...