Issues that are encountered while installing and using Sysbench
One is the source code installation system environment requirements:
You need to install M4 autoconf Automake libtool These packages, which can be installed via Yum install M4 autoconf automake
Otherwise, you will report the following error:
[Root@sever2 sysbench-0.4.12-1.1]#./autogen.sh
Automake 1.10.x (aclocal) wasn ' t found, exiting
[Root@sever2 sysbench-0.4.12-1.1]#./autogen.sh
Libtoolize 1.4+ wasn ' t found, exiting
Second, after the implementation of autogen.sh./configure, if used to test MySQL, specify a few parameters. The designation is wrong.
–with-mysql-includes and –with-mysql-libs
[Root@sever2 sysbench-0.4.12-1.1]#./configure--with-mysql-includes=/usr/local/mysql/include--with-mysql-libs=/ Usr/local/mysql/lib
。。。。。 Slightly
[Root@sever2 sysbench-0.4.12-1.1]# make
MAKE[3]: Entering directory '/home/packages/sysbench-0.4.12-1.1/sysbench/drivers/mysql '
Gcc-dhave_config_h-i.-I.. /.. /.. /config-i/usr/local/mysql/include-i.. /.. /.. /sysbench-d_xopen_source=500-d_gnu_source-w-wall-wextra-wpointer-arith-wbad-function-cast-wstrict-prototypes-w Nested-externs-winline-funroll-loops-wundef-wstrict-prototypes-wmissing-prototypes-wmissing-declarations- WREDUNDANT-DECLS-WCAST-ALIGN-PTHREAD-O2-GGDB3-MT LIBSBMYSQL_A-DRV_MYSQL.O-MD-MP-MF. deps/libsbmysql_a-drv_ Mysql. Tpo-c-o libsbmysql_a-drv_mysql.o ' test-f ' drv_mysql.c ' | | echo './' DRV_MYSQL.C
DRV_MYSQL.C:36:19: Error: mysql.h: no file or directory
DRV_MYSQL.C:37:26: Error: Mysqld_error.h: no file or directory
Drv_mysql.c:43:5: Warning: "mysql_version_id" not defined
Drv_mysql.c:48:5: Warning: "mysql_version_id" not defined
DRV_MYSQL.C: In the function ' Mysql_drv_init ':
drv_mysql.c:244: Warning: Implicit declaration of function ' Mysql_library_init '
drv_mysql.c:244: Warning: Nested external declaration of ' Mysql_library_init '
DRV_MYSQL.C: In the function ' Mysql_drv_connect ':
drv_mysql.c:266: Error: ' MySQL ' not declared (used for the first time in this function)
drv_mysql.c:266: Error: (even if multiple occurrences occur within a function, each undeclared identifier in its
drv_mysql.c:266: Error: Only one report is reported within the function. )
drv_mysql.c:266: Error: ' Con ' not declared (used for the first time in this function)
drv_mysql.c:273: Error: expected expression before ') ' token
drv_mysql.c:279: Warning: Implicit declaration of function ' Mysql_init '
drv_mysql.c:279: Warning: Nested external declaration of ' Mysql_init '
drv_mysql.c:318: Warning: Implicit declaration of function ' Mysql_ssl_set '
drv_mysql.c:318: Warning: Nested external declaration of ' Mysql_ssl_set '
drv_mysql.c:321: Error: ' mysql_version_id ' not declared (first use in this function)
drv_mysql.c:331: Warning: Implicit declaration of function ' Mysql_real_connect '
drv_mysql.c:331: Warning: Nested external declaration of ' Mysql_real_connect '
Drv_mysql.c:338:5: Warning: "mysql_version_id" not defined
drv_mysql.c:346: Warning: Implicit declaration of function ' Mysql_errno '
drv_mysql.c:346: Warning: Nested external declaration of ' Mysql_errno '
drv_mysql.c:347: Warning: Implicit declaration of function ' Mysql_error '
drv_mysql.c:347: Warning: Nested external declaration of ' Mysql_error '
DRV_MYSQL.C: In the function ' Mysql_drv_disconnect ':
drv_mysql.c:361: Error: ' MySQL ' not declared (used for the first time in this function)
drv_mysql.c:361: Error: ' Con ' not declared (used for the first time in this function)
drv_mysql.c:366: Warning: Implicit declaration of function ' Mysql_close '
drv_mysql.c:366: Warning: Nested external declaration of ' Mysql_close '
DRV_MYSQL.C: In the function ' Mysql_drv_bind_param ':
drv_mysql.c:441: Error: ' MySQL ' not declared (used for the first time in this function)
drv_mysql.c:441: Error: ' Con ' not declared (used for the first time in this function)
drv_mysql.c:441: Error: expected expression before ') ' token
DRV_MYSQL.C: In the function ' Mysql_drv_query ':
drv_mysql.c:657: Error: ' MySQL ' not declared (used for the first time in this function)
drv_mysql.c:657: Error: ' Con ' not declared (used for the first time in this function)
drv_mysql.c:661: Warning: Implicit declaration of function ' Mysql_real_query '
drv_mysql.c:661: Warning: Nested external declaration of ' Mysql_real_query '
drv_mysql.c:667: Error: ' Er_lock_deadlock ' not declared (first use in this function)
drv_mysql.c:667: Error: ' Er_lock_wait_timeout ' not declared (first use in this function)
drv_mysql.c:668: Error: ' Er_checkread ' not declared (first use in this function)
DRV_MYSQL.C: In the function ' Mysql_drv_fetch_row ':
drv_mysql.c:696: Warning: Implicit declaration of function ' Mysql_fetch_row '
DRV_MYSQL.C:696: Warning: Nested external declaration of ' Mysql_fetch_row '
drv_mysql.c:696: Warning: Assigning integers to pointers, no type conversions
DRV_MYSQL.C: In the function ' Mysql_drv_store_results ':
drv_mysql.c:723: Error: ' MySQL ' not declared (used for the first time in this function)
drv_mysql.c:723: Error: ' Con ' not declared (used for the first time in this function)
drv_mysql.c:724: Error: ' Mysql_res ' not declared (first use in this function)
drv_mysql.c:724: Error: ' res ' not declared (used for the first time in this function)
drv_mysql.c:725: Error: ' Mysql_row ' not declared (first use in this function)
drv_mysql.c:725: Error: expected '; ' before ' Row '
drv_mysql.c:769: Warning: Implicit declaration of function ' Mysql_store_result '
drv_mysql.c:769: Warning: Nested external declaration of ' Mysql_store_result '
drv_mysql.c:775: Error: ' Er_lock_deadlock ' not declared (first use in this function)
drv_mysql.c:775: Error: ' Er_lock_wait_timeout ' not declared (first use in this function)
drv_mysql.c:776: Error: ' Er_checkread ' not declared (first use in this function)
drv_mysql.c:783: Warning: Implicit declaration of function ' Mysql_field_count '
drv_mysql.c:783: Warning: Nested external declaration of ' Mysql_field_count '
drv_mysql.c:790: Warning: Implicit declaration of function ' Mysql_num_rows '
drv_mysql.c:790: Warning: Nested external declaration of ' mysql_num_rows '
drv_mysql.c:794: Error: ' Row ' not declared (first use in this function)
DRV_MYSQL.C: In the function ' Mysql_drv_free_results ':
drv_mysql.c:817: Warning: Implicit declaration of function ' Mysql_free_result '
drv_mysql.c:817: Warning: Nested external declaration of ' Mysql_free_result '
drv_mysql.c:817: Error: ' Mysql_res ' not declared (first use in this function)
drv_mysql.c:817: Error: expected expression before ') ' token
DRV_MYSQL.C: In the function ' Mysql_drv_done ':
drv_mysql.c:851: Warning: Implicit declaration of function ' Mysql_library_end '
drv_mysql.c:851: Warning: Nested external declaration of ' Mysql_library_end '
MAKE[3]: * * * [LIBSBMYSQL_A-DRV_MYSQL.O] Error 1
MAKE[3]: Leaving directory '/home/packages/sysbench-0.4.12-1.1/sysbench/drivers/mysql '
MAKE[2]: * * * [all-recursive] Error 1
MAKE[2]: Leaving directory '/home/packages/sysbench-0.4.12-1.1/sysbench/drivers '
MAKE[1]: * * * [all-recursive] Error 1
MAKE[1]: Leaving directory '/home/packages/sysbench-0.4.12-1.1/sysbench '
Make: * * * * [all-recursive] Error 1
The error in the report is mainly the problem specified by the LIB and include directories.
[Root@sever2 sysbench-0.4.12-1.1]# Ls/usr/local/mysql/include/mysql/mysql.h
/usr/local/mysql/include/mysql/mysql.h
Re-configure specified to the correct directory
[Root@sever2 sysbench-0.4.12-1.1]#./configure--with-mysql-includes=/usr/local/mysql/include/mysql/-- With-mysql-libs=/usr/local/mysql/lib/mysql
If there is no error, a binary executable is generated in the current Sysbench directory: Sysbench
[Root@sever2 sysbench]# Ll-rth Sysbench
-rwxr-xr-x. 1 root 3.2M November 19:27 sysbench