简体   繁体   English

RMySQL在Fedora 28上安装错误

[英]RMySQL installing error on Fedora 28

I have already seen this RMySQL installing error on Fedora 28, Rstudio version 1.1.4, Question and answer but I do not have that issue. 我已经在Fedora 28,Rstudio版本1.1.4,问答中看到此RMySQL安装错误,但我没有这个问题。

I am installing MySQL using 我正在使用安装MySQL

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

and I am getting: 我得到:

  • installing to library '/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5' 安装到库'/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! 安装软件包“ RMySQL” ... **软件包“ RMySQL”已成功解压,并检查了MD5的总和。找到mysql_config cflags和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 使用PKG_CFLAGS = -I / usr / include / mysql -m64使用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.ofields.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 -保护-fcf-保护-c RMySQL-init.c -o RMySQL-init.o gcc -m64 -I“ / usr / include / R” -DNDEBUG -I / usr / include / mysql -m64 -I / usr /本地/包括-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'; / 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'; did you mean 'bool'? 你是说“布尔”吗? my_bool tmp; my_bool tmp; ^~~~~~~ bool make: *** [/usr/lib64/R/etc/Makeconf:159: connection.o] Error 1 ERROR: compilation failed for package 'RMySQL' ^ ~~~~~~ bool make:*** [/ usr / lib64 / R / etc / Makeconf:159:connection.o]错误1错误:软件包“ RMySQL”的编译失败
    • removing '/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5/RMySQL' 删除'/home/Trina/R/x86_64-redhat-linux-gnu-library/3.5/RMySQL'

I am facing the same problem using install.packages in Rstudio. 我在Rstudio中使用install.packages遇到相同的问题。 Thanks for any help from the community. 感谢社区的任何帮助。

This error is something related to mysql >= 8.0 installed in the linux. 此错误与Linux中安装的mysql> = 8.0有关。

As per below mysql website, from MySQL 8.0 onwards my_bool type replaced to bool or int C type. 按照下面的mysql网站,从MySQL 8.0开始,将my_bool类型替换为bool或int C类型。

(Use Ctl+F in below URL and search for my_bool keyword to go straight into the update) (在下面的URL中使用Ctl + F并搜索my_bool关键字可直接进入更新)

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

Workaround to resolve the issue 解决问题的解决方法

Unzip the RMySQL tar file and look for connection.c file under src folder. 解压缩RMySQL tar文件,并在src文件夹下查找connection.c文件。

In the connection.c file, just replace my_bool to bool type. 在connection.c文件中,只需将my_bool替换为bool类型。 After that, tar the RMySQL folder that has modified connection.c file and use this updated RMySQL tar file for installation using R CMD INSTALL. 然后,tar已修改了connection.c文件的RMySQL文件夹,并使用此更新的RMySQL tar文件通过R CMD INSTALL安装。

Please try the above approach and let me know if it solves the issue. 请尝试上述方法,让我知道它是否可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM