记录一次麒麟V10 安装sysbench各种报错(关于MySQL)处理过程

sysbench手工下载: https://github.com/akopytov/sysbench

下载.zip文件,上传到服务器上

解压、安装:

unzip sysbench-master.zip

cd sysbench-master/

sh autogen.sh

./configure

报错:没有mysql驱动

configure: error: mysql_config executable not found
********************************************************************************
ERROR: cannot find MySQL libraries. If you want to compile with MySQL support,
       please install the package containing MySQL client libraries and headers.
       On Debian-based systems the package name is libmysqlclient-dev.
       On RedHat-based systems, it is mysql-devel.
       If you have those libraries installed in non-standard locations,
       you must either specify file locations explicitly using
       --with-mysql-includes and --with-mysql-libs options, or make sure path to
       mysql_config is listed in your PATH environment variable. If you want to
       disable MySQL support, use --without-mysql option.
********************************************************************************

麒麟V10上没有MySQL安装包,仅有mariadb的,sysbench上也提示安装mariadb-devel即可。

[root@n110 sysbench-master]#  yum install mysql-devel
Last metadata expiration check: 1:09:03 ago on 2024年07月05日 星期五 08时45分36秒.
No match for argument: mysql-devel
Error: Unable to find a match: mysql-devel

[root@n110 sysbench-master]# yum -y install mariadb-devel
...

[root@n110 sysbench-master]# ./configure  
--很多输出信息,OK 成功

[root@n110 sysbench-master]# make  
--

但是执行make的时候又报错了:/usr/include/mysql/mysql.h:440:3: 警告:函数声明不是一个原型 [-Wstrict-prototypes]

make[3]: 进入目录“/root/database/sysbench-master/src/drivers/mysql”
gcc -DHAVE_CONFIG_H -I. -I../../../config  -I/usr/include/mysql -I/usr/include/mysql/mysql -I../../../src -I/root/database/sysbench-master/third_party/luajit/inc -I/root/database/sysbench-master/third_party/concurrency_kit/include -D_GNU_SOURCE  -DCK_MD_CACHELINE=128 -Wall -Wextra -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align -Wvla   -pthread -O3 -funroll-loops -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
In file included from drv_mysql.c:34:0:
/usr/include/mysql/mysql.h:440:3: 警告:函数声明不是一个原型 [-Wstrict-prototypes]
   MYSQL_CLIENT_PLUGIN_HEADER
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
drv_mysql.c: 在函数‘mysql_drv_real_connect’中:
drv_mysql.c:420:24: 错误:‘MYSQL_OPT_COMPRESSION_ALGORITHMS’ undeclared (first use in this function); did you mean ‘MYSQL_OPT_COMPRESS’?
     mysql_options(con, MYSQL_OPT_COMPRESSION_ALGORITHMS, args.compression_alg);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        MYSQL_OPT_COMPRESS

菜鸟一个,也不知道怎么解决,感觉就是版本之间兼容性的问题,那就换了mariadb,还是安装mysql吧。

登录MySQL官网下载地址:MySQL :: Download MySQL Community Server

登录、注册,不需要,直接点下面的小蓝字,下载就可以了

上传服务器,解压,安装

tar -xvf mysql-9.0.0-1.el8.aarch64.rpm-bundle.tar
#按顺序执行以下内容
rpm -ivh mysql-community-common-9.0.0-1.el8.aarch64.rpm
rpm -ivh mysql-community-client-plugins-9.0.0-1.el8.aarch64.rpm
rpm -ivh mysql-community-libs-9.0.0-1.el8.aarch64.rpm
rpm -ivh mysql-community-client-9.0.0-1.el8.aarch64.rpm
rpm -ivh mysql-community-devel-9.0.0-1.el8.aarch64.rpm

安装 mysql-community-devel 的时候又出现告警提示,存在mariadb-devel等等,会被覆盖

那就卸载掉所有的mariadb相关的东西。

yum remove -y mariadb-*
#检查还有没有残留的rpm
rpm -qa|grep mariadb
##如果有,统统卸载
rpm -e --nodeps mariadb-connector-c-3.0.6-8.p01.ky10.aarch64
rpm -e --nodeps mariadb-connector-c-devel-3.0.6-8.p01.ky10.aarch64
rpm -e --nodeps mariadb-devel-10.3.39-1.p01.ky10.aarch64

#继续安装mysql-devel
rpm -ivh mysql-community-devel-9.0.0-1.el8.aarch64.rpm

#然后,回去继续安装sysbench

make -j
#...,有一些类似这样的提示,不需要管 make[2]: 离开目录“/root/database/sysbench-master/src”
make install
#...,有大量这样的提示,不需要管 make[2]: 离开目录“/root/database/sysbench-master/src”

sysbench --version
#sysbench 1.1.0

###安装成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天下观查

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值