简体   繁体   中英

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.

I am installing MySQL using

R CMD INSTALL /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'
    • 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'

I am facing the same problem using install.packages in Rstudio. Thanks for any help from the community.

This error is something related to mysql >= 8.0 installed in the linux.

As per below mysql website, from MySQL 8.0 onwards my_bool type replaced to bool or int C type.

(Use Ctl+F in below URL and search for my_bool keyword to go straight into the update)

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

Workaround to resolve the issue

Unzip the RMySQL tar file and look for connection.c file under src folder.

In the connection.c file, just replace my_bool to bool type. 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.

Please try the above approach and let me know if it solves the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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