如何解决使mysql-connector-c++-1.1.7错误

How to solve make mysql-connector-c++-1.1.7 error

本文关键字:mysql-connector-c++-1 错误 何解决 解决      更新时间:2023-10-16

我跟随https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-unix.html当我使用make下面是我发生的事情

[  8%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o
/root/git/MetricBench.perclab/build/mysql-connector-cpp/driver/mysql_resultbind.cpp: In function ‘sql::mysql::st_buffer_size_type sql::mysql::allocate_buffer_for_field(const MYSQL_FIELD*)’:
/root/git/MetricBench.perclab/build/mysql-connector-cpp/driver/mysql_resultbind.cpp:89:10: error: ‘MYSQL_TYPE_JSON’ was not declared in this scope
     case MYSQL_TYPE_JSON:
          ^
driver/CMakeFiles/mysqlcppconn.dir/build.make:284: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o' failed
make[2]: *** [driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o] Error 1
CMakeFiles/Makefile2:92: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/all' failed
make[1]: *** [driver/CMakeFiles/mysqlcppconn.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

我曾经找到其他人提供的解决方案

This can be fixed by checking for the MYSQL_TYPE_JSON at compile time and optionally including those switch/case conditionals only if detected in the underlying C API.

我真的不知道该怎么解决这个问题,有什么建议吗?thx

使用mysql-connector-c++-1.1.6。1.1.7添加了JSON类型,连接器C 6.1.6似乎不支持它,或者需要进行一些额外的更改。

也许是别的原因,但我没有太在意,1.1.6就像一种魅力。

找到它:


MySQL连接器/C++1.1.7的变化(2016-01-20)

若要从源代码构建Connector/C++,必须使用MySQL 5.7(5.7.9或更高版本)的General Availability版本或Connector/C 6.1.8或更高级别

https://dev.mysql.com/doc/relnotes/connector-cpp/en/news-1-1-7.html


第二个误区是在哪里下载连接器/C 6.1.8源代码?下载页面(https://dev.mysql.com/downloads/connector/c/)在我写这篇文章的时候,它只提供连接器/C 6.1.6…

经过另一项研究,连接器/C 6.1.7和6.1.8似乎不会以社区版本发布(https://downloads.mysql.com/docs/connector-c-relnotes-en.a4.pdf)但是,在本文档中没有提到在6.1.8:中添加JSON类型支持


MySQL连接器/C 6.1.8的变化(2015-12-15)

安全注意事项•此版本的Connector/C将链接的OpenSSL库升级到1.0.1p版本新的OpenSSL版本在http://www.openssl.org/news/vulnerabilities.html.

MySQL连接器/C 6.1.7的更改(2015-04-21)

安全说明•安全修复:Connector/C 6.1 Commercial已更新为使用OpenSSL 1.0.1m版本,据公开报道,它不易受到CVE-2015-0286的攻击。由于Connector/C 6.1.7中唯一的变化是包含了公开报告的OpenSSL库不受CVE-2015-0286的影响,并且由于Oracle生产的MySQL社区构建使用YaSSL据报道未受CVE-2015-0286影响的库,Oracle将不会生成内部版本用于连接器/C社区的6.1.7版本。这意味着社区版连接器/C将跳过版本6.1.7。(Bug#20747718,CVE-2015-0286)