mysql - RMySQL 在 Fedora 28 上安装错误

标签 mysql r rmysql

我已经看过这个RMySQL installing error on Fedora 28, Rstudio version 1.1.4,问答,但我没有那个问题。

我正在使用

安装 MySQL

R CMD INSTALL /home/Trina/Downloads/RMySQL_0.10.14.tar.gz

我得到:

  • installing to library ‘/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5’
    • installing source package ‘RMySQL’ ... ** package ‘RMySQL’ successfully unpacked and MD5 sums checked Found mysql_config cflags and libs! Using PKG_CFLAGS=-I/usr/include/mysql -m64 Using PKG_LIBS=-L/usr/lib64/mysql -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl ** libs rm -f RMySQL.so RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o gcc -m64 -I"/usr/include/R" -DNDEBUG -I/usr/include/mysql -m64 -I/usr/local/include -fpic -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c RMySQL-init.c -o RMySQL-init.o gcc -m64 -I"/usr/include/R" -DNDEBUG -I/usr/include/mysql -m64 -I/usr/local/include -fpic -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c connection.c -o connection.o connection.c: In function ‘RS_MySQL_moreResultSets’: connection.c:224:3: error: unknown type name ‘my_bool’; did you mean ‘bool’? my_bool tmp; ^~~~~~~ bool make: *** [/usr/lib64/R/etc/Makeconf:159: connection.o] Error 1 ERROR: compilation failed for package ‘RMySQL’
    • removing ‘/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5/RMySQL’

我在 Rstudio 中使用 install.packages 时遇到了同样的问题。 感谢社区的任何帮助。

最佳答案

此错误与 mysql >= 8.0 安装在 linux 中有关。

根据以下mysql网站,从MySQL 8.0开始,my_bool类型替换为bool或int C类型。

(在下面的网址中使用 Ctl+F 并搜索 my_bool 关键字直接进入更新)

https://dev.mysql.com/doc/refman/8.0/en/c-api-data-structures.html

解决问题的解决方法

解压缩 RMySQL tar 文件并在 src 文件夹下查找 connection.c 文件。

connection.c文件中,将my_bool替换为bool类型即可。 之后,tar 已修改 connection.c 文件的 RMySQL 文件夹,并使用此更新的 RMySQL tar 文件使用 R CMD INSTALL 进行安装。

请尝试上述方法,如果它能解决问题,请告诉我。

关于mysql - RMySQL 在 Fedora 28 上安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51280112/

相关文章:

mysql - 在 Windows 7 : "RMySQL was compiled with MySQL 5.5.28 but loading MySQL 6.0.0 instead" 中安装 RMySQL

php - 我可以在匹配时将一个表的输出值替换为另一表的值吗?

r - 如何为列中每组相同值分配唯一的 ID 号

r - 无法分配新连接: 16 connections already opened RMySQL

mysql - 通过 SSH 连接到 R 中的 MySQL 数据库

r - 矩阵乘法(逐行)

php - 安全地存储从Docker容器访问的MySQL凭据

python - 使用 django 查询从多个表中检索详细信息

php - 从 MySQL 填充 PHP 销售表(包括空月)

r - knitr 在文档中生成错误,但无论如何都能正确生成数字