【问题标题】:RMySQL installing error on Fedora 28Fedora 28 上的 RMySQL 安装错误
【发布时间】:2018-12-19 04:16:19
【问题描述】:

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

我正在使用

安装 MySQL

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

我得到了:

  • 安装到库 '/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5'
    • 正在安装源代码包'RMySQL' ... ** 包‘RMySQL’成功解包并检查MD5总和 找到 mysql_config cflags 和库! 使用 PKG_CFLAGS=-I/usr/include/mysql -m64 使用 PKG_LIBS=-L/usr/lib64/mysql -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl ** 库 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:在函数“RS_MySQL_moreResultSets”中: connection.c:224:3:错误:未知类型名称“my_bool”;您指的是 “bool” 吗? my_bool tmp; ^~~~~~~ 布尔 make: *** [/usr/lib64/R/etc/Makeconf:159: connection.o] 错误 1 错误:包“RMySQL”编译失败
    • 删除“/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5/RMySQL”

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

【问题讨论】:

  • 我的猜测是您缺少依赖项。您是否尝试过搜索例如“rmysql fedora r”?
  • 在 Debian 上,适用于许多有问题的软件包的方法是将它们安装在 R 中而不是作为 Debian 软件包(使用 apt-get install)。显然,这只有在存在这样的 Debian 软件包时才有效。困难可能是安装需要一些外部工具,例如编译器,而 R 不容易找到它们。另一个潜在的困难来源是您的 mysql 安装,例如必须与您的 r 安装匹配的 32 位与 64 位架构
  • 我在 Ubuntu 18 上也遇到了同样的错误。似乎找不到任何解决方案。

标签: mysql r rmysql


【解决方案1】:

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

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

(在下面的 URL 中使用 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 进行安装。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-30
    • 2021-09-05
    • 2012-03-15
    • 1970-01-01
    • 1970-01-01
    • 2014-08-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多