涉及到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时报错:

  1. drv_mysql.c:36:19: error: mysql.h: No such file or directory
  2. drv_mysql.c:37:26: error: mysqld_error.h: No such file or directory
  3. drv_mysql.c:43:5: warning: "MYSQL_VERSION_ID" is not defined
  4. drv_mysql.c:48:5: warning: "MYSQL_VERSION_ID" is not defined
  5. drv_mysql.c: In function ‘mysql_drv_init’:
  6. drv_mysql.c:240: warning: implicit declaration of function ‘mysql_library_init’
  7. drv_mysql.c:240: warning: nested extern declaration of ‘mysql_library_init’
  8. drv_mysql.c: In function ‘mysql_drv_connect’:
  9. drv_mysql.c:262: error: ‘MYSQL’ undeclared (first use in this function)
  10. drv_mysql.c:262: error: (Each undeclared identifier is reported only once
  11. drv_mysql.c:262: error: for each function it appears in.)
  12. drv_mysql.c:262: error: ‘con’ undeclared (first use in this function)
  13. drv_mysql.c:268: error: expected expression before ‘)’ token
  14. drv_mysql.c:274: warning: implicit declaration of function ‘mysql_init’
  15. drv_mysql.c:274: warning: nested extern declaration of ‘mysql_init’
  16. drv_mysql.c:300: warning: implicit declaration of function ‘mysql_ssl_set’
  17. drv_mysql.c:300: warning: nested extern declaration of ‘mysql_ssl_set’
  18. drv_mysql.c:303: error: ‘MYSQL_VERSION_ID’ undeclared (first use in this function)
  19. drv_mysql.c:313: warning: implicit declaration of function ‘mysql_real_connect’
  20. drv_mysql.c:313: warning: nested extern declaration of ‘mysql_real_connect’
  21. drv_mysql.c:320:5: warning: "MYSQL_VERSION_ID" is not defined
  22. drv_mysql.c:328: warning: implicit declaration of function ‘mysql_errno’
  23. drv_mysql.c:328: warning: nested extern declaration of ‘mysql_errno’
  24. drv_mysql.c:329: warning: implicit declaration of function ‘mysql_error’
  25. drv_mysql.c:329: warning: nested extern declaration of ‘mysql_error’
  26. drv_mysql.c: In function ‘mysql_drv_disconnect’:
  27. drv_mysql.c:343: error: ‘MYSQL’ undeclared (first use in this function)
  28. drv_mysql.c:343: error: ‘con’ undeclared (first use in this function)
  29. drv_mysql.c:348: warning: implicit declaration of function ‘mysql_close’
  30. drv_mysql.c:348: warning: nested extern declaration of ‘mysql_close’
  31. drv_mysql.c: In function ‘mysql_drv_bind_param’:
  32. drv_mysql.c:423: error: ‘MYSQL’ undeclared (first use in this function)
  33. drv_mysql.c:423: error: ‘con’ undeclared (first use in this function)
  34. drv_mysql.c:423: error: expected expression before ‘)’ token
  35. drv_mysql.c: In function ‘mysql_drv_query’:
  36. drv_mysql.c:639: error: ‘MYSQL’ undeclared (first use in this function)
  37. drv_mysql.c:639: error: ‘con’ undeclared (first use in this function)
  38. drv_mysql.c:643: warning: implicit declaration of function ‘mysql_real_query’
  39. drv_mysql.c:643: warning: nested extern declaration of ‘mysql_real_query’
  40. drv_mysql.c:649: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
  41. drv_mysql.c:649: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
  42. drv_mysql.c:650: error: ‘ER_CHECKREAD’ undeclared (first use in this function)
  43. drv_mysql.c: In function ‘mysql_drv_fetch_row’:
  44. drv_mysql.c:678: warning: implicit declaration of function ‘mysql_fetch_row’
  45. drv_mysql.c:678: warning: nested extern declaration of ‘mysql_fetch_row’
  46. drv_mysql.c:678: warning: assignment makes pointer from integer without a cast
  47. drv_mysql.c: In function ‘mysql_drv_store_results’:
  48. drv_mysql.c:705: error: ‘MYSQL’ undeclared (first use in this function)
  49. drv_mysql.c:705: error: ‘con’ undeclared (first use in this function)
  50. drv_mysql.c:706: error: ‘MYSQL_RES’ undeclared (first use in this function)
  51. drv_mysql.c:706: error: ‘res’ undeclared (first use in this function)
  52. drv_mysql.c:707: error: ‘MYSQL_ROW’ undeclared (first use in this function)
  53. drv_mysql.c:707: error: expected ‘;’ before ‘row’
  54. drv_mysql.c:751: warning: implicit declaration of function ‘mysql_store_result’
  55. drv_mysql.c:751: warning: nested extern declaration of ‘mysql_store_result’
  56. drv_mysql.c:757: error: ‘ER_LOCK_DEADLOCK’ undeclared (first use in this function)
  57. drv_mysql.c:757: error: ‘ER_LOCK_WAIT_TIMEOUT’ undeclared (first use in this function)
  58. drv_mysql.c:758: error: ‘ER_CHECKREAD’ undeclared (first use in this function)
  59. drv_mysql.c:765: warning: implicit declaration of function ‘mysql_field_count’
  60. drv_mysql.c:765: warning: nested extern declaration of ‘mysql_field_count’
  61. drv_mysql.c:772: warning: implicit declaration of function ‘mysql_num_rows’
  62. drv_mysql.c:772: warning: nested extern declaration of ‘mysql_num_rows’
  63. drv_mysql.c:776: error: ‘row’ undeclared (first use in this function)
  64. drv_mysql.c: In function ‘mysql_drv_free_results’:
  65. drv_mysql.c:799: warning: implicit declaration of function ‘mysql_free_result’
  66. drv_mysql.c:799: warning: nested extern declaration of ‘mysql_free_result’
  67. drv_mysql.c:799: error: ‘MYSQL_RES’ undeclared (first use in this function)
  68. 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

  1. Missing required command argument.
  2. Usage:
  3. sysbench [general-options]... --test=<test-name> [test-options]... command
  4. General options:
  5. --num-threads=N            number of threads to use [1]
  6. --max-requests=N           limit for total number of requests [10000]
  7. --max-time=N               limit for total execution time in seconds [0]
  8. --forced-shutdown=STRING   amount of time to wait after --max-time before forcing shutdown [off]
  9. --thread-stack-size=SIZE   size of stack per thread [64K]
  10. --tx-rate=N                target transaction rate (tps) [0]
  11. --tx-jitter=N              target transaction variation, in microseconds [0]
  12. --report-interval=N        periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
  13. --test=STRING              test to run
  14. --debug=[on|off]           print more debugging info [off]
  15. --validate=[on|off]        perform validation checks where possible [off]
  16. --help=[on|off]            print help and exit
  17. --version=[on|off]         print version and exit [off]
  18. --rand-init=[on|off]       initialize random number generator [off]
  19. --rand-type=STRING         random numbers distribution {uniform,gaussian,special} [special]
  20. --rand-spec-iter=N         number of iterations used for numbers generation [12]
  21. --rand-spec-pct=N          percentage of values to be treated as 'special' (for special distribution) [1]
  22. --rand-spec-res=N          percentage of 'special' values to use (for special distribution) [75]
  23. --rand-seed=N              seed for random number generator, ignored when 0 [0]
  24. Log options:
  25. --verbosity=N      verbosity level {5 - debug, 0 - only critical messages} [3]
  26. --percentile=N      percentile rank of query response times to count [95]
  27. Compiled-in tests:
  28. fileio - File I/O test
  29. cpu - CPU performance test
  30. memory - Memory functions speed test
  31. threads - Threads subsystem performance test
  32. mutex - Mutex performance test
  33. Commands: prepare run cleanup help version
  34. 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下载安装的更多相关文章

  1. CentOS6.6系统源代码安装mysql5.5.28教程(附源码包下载地址)+sysbench的安装

    mysql从5.5版本开始,不再使用./configure编译,而是使用cmake编译器,具体的cmake编译参数可以参考mysql官网文档(※ 非常重要) http://dev.mysql.com/ ...

  2. sysbench下载与安装

    目标:下载.安装sysbench软件,做数据库压测 准备: 在sysbench启动的linux机器上,首先安装好mysql,查看mysql已经启动 例如,在机器上已经安装完mysql,其路径为 /us ...

  3. sysbench工具安装使用

    一.sysbench简介 Sysbench是一款开源的.跨平台的.模块化的.多线程的性能测试工具,通过高负载地运行在数据库上,可以执行CPU.内存.线程.IO.数据库等方面的性能测试.用于评估操作系统 ...

  4. sysbench的安装和做性能测试

    sysbench的安装和做性能测试 http://imysql.cn/node/312 sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况. ...

  5. 安装特定版本 sysbench 以及安装时指定特定的mysql客户端

    step1: 下载安装源码 https://github.com/akopytov/sysbench (git clone https://github.com/akopytov/sysbench.g ...

  6. sysbench的安装详解

    sysbench是一个压力测试工具.可以用它来测试cpu.mem.disk.thread.mysql.postgr.oracle:然而作为一个mysql dba 我当然是用它来压测mysql啦! 一. ...

  7. 【转帖】sysbench的安装和做性能测试

    iMySQL | 老叶茶馆 sysbench的安装和做性能测试 http://imysql.cn/node/312 我仿照这个学的 但是 需要用更新的版本才可以.   By yejr on 14 六月 ...

  8. 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 ...

  9. jdk1.8下载安装

    jdk8环境变量 jdk8图解安装 java8安装   1 2 3 4 5 6 7 分步阅读 JDK8 是JDK的最新版本,加入了很多新特性,如果我们要使用,需要下载安装: JDK8在windows ...

随机推荐

  1. RabbitMQ(三)RabbitMQ消息过期时间(TTL)

    在RabbitMQ(二)AMQP协议mandatory和immediate标志位区别中我们提到,在RabbitMQ3.0以后的版本里,去掉了immediate参数支持,要实现类似的确认功能要使用TTL ...

  2. C语言预处理命令总结大全 :宏定义

    C程序的源代码中可包括各种编译指令,这些指令称为预处理命令.虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境.本节将介绍如何应用预处理程序和注释简化程序开发过程,并提高程序的可读性.ANS ...

  3. [TJOI2016&HEOI2016] 排序

    [题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=4552 [算法] 首先 , 二分答案x , 将比x小的数看作1,比x大的数看作0 然后 ...

  4. 使用Visual Studio 利用WinGDB编译和远程调试嵌入式Linux的程序

    写这篇文章的目的在于帮助那些既要使用Visual Studio编写程序又要开发和调试嵌入式Linux 程序的苦命程序员们! 第一步, 安装 WinGDB ,下载位置  http://www.wingd ...

  5. mysql 数据库的名称不能以数字开头

    mysql  数据库的名称不能以数字开头

  6. SOLID总结(未完待续)

    SOLID原则是著名的面向对像设计五原则,之所以要引入这些原则,是为了给以防止代码腐化而进行的重构活动定下切实可行的目标. 随着系统开发的进行,产品代码不可避免地会不断腐化,就算在开发过程中很好地应用 ...

  7. PCB Genesis SET拼板(圆形板拼板) 实现效果(二)

    越来发现Genesis采用Surface多边形数据结构的重要性了,当撑握了多边形缩放,交集, 差集,并集等算法, 想实现PCB拼板简直轻而易举了;当然借助多边形算法可以开发出更多的PCB实用的工具出来 ...

  8. bzoj 3779: 重组病毒【LCT+线段树维护dfs序】

    %.8lf会WA!!%.8lf会WA!!%.8lf会WA!!要%.10lf!! 和4817有点像,但是更复杂. 首先对于操作一"在编号为x的计算机中植入病毒的一个新变种,在植入一个新变种时, ...

  9. Educational Codeforces Round 52 (Rated for Div. 2) F. Up and Down the Tree 树型DP

    题面 题意:给你一棵树,你起点在1,1也是根节点,你每次可以选择去你子树的某个叶子节点,也可以选择,从叶子节点返回距离不超过k的一个根, 也就是说,你从1开始,向下跳,选择一个叶子(就是没有子树的节点 ...

  10. 一条SQL语句是如何执行的?--Mysql45讲笔记记录 打卡day1

    写在前面的话:回想以前上班的时候,空闲时间还是挺多的,但是都荒废了.如今找工作着实费劲了.但是这段时间在极客时间买了mysql45讲,就好像发现了新大陆一样,这是我认真做笔记的第一天,说实话第一讲我已 ...