installing RMySQL gives error RS-MySQL.h:32:19: fatal error: mysql.h: No such file
Asked Answered
C

4

3

I tried to install the RMySQL-library (R version 2.14.2, WinXP on 32bit) but got the following error message:

install.packages("D:/R/library/RMySQL_0.9-3.tar.gz",repos=NULL, type="source")

...

RS-MySQL.h:32:19: fatal error: mysql.h: No such file or directory
compilation terminated.
make: *** [RS-MySQL.o] Error 1
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/Dokumente und Einstellungen/Giordano/R/win-library/2.14/RMySQL'
Warning message:
In install.packages("D:/R/library/RMySQL_0.9-3.tar.gz", repos = NULL,  :
  installation of package 'D:/R/library/RMySQL_0.9-3.tar.gz' had non-zero exit status

This is only a part of the output which contains the error message. I do not understand this message and maybe somebode can give me some advices. Thanks for help. giordano.

Calces answered 22/4, 2012 at 18:4 Comment(4)
My first advice would be to read the documentation on installing this package from source. Just scanning it revealed a potential answer.Lockup
I second @joran's advice, but I would encourage you to read the error message carefully... especially the part about "mysql.h: No such file or directory".Loreanloredana
I posted a bit more informative answer, maybe not the best option if I want the OP to learn how to fish :)Catechist
@to all, thanks for the reply: yes, I read it. But I didn't understand what the problem is. Yes, I assumed that the problem has to do with mysql.h. But what is mysql.h? How can I solve this problem?Calces
L
3

Some pointers to installing mysql header libraries are found here :

https://github.com/jeffreyhorner/RMySQL

(site seems to have moved here now)

http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

Key is to have a Renviron.site file in the R\etc folder and having libmysql.dll in the correct places before compiling from source.

good luck.

Libava answered 29/6, 2012 at 13:12 Comment(0)
C
3

R cannot find the MySQL header files that it needs to build the package. As the documentation states:

You need to have installed 'C Include Files / Lib Files' as part of your MySQL installation when installing the MySQL binary distribution.

The fix is to install the MySQL header files.

Catechist answered 22/4, 2012 at 21:44 Comment(2)
Thanks for the reply. So, I have to reinstall MySQL? Or is there another way to get this library and if yes, where to install? The strange thing is that I used MySQL/R since many years and had no problem. Since the new version of R I installed recently I have this kind problem. So, does the old version of R/RMySQL works without MySQL.h and the new needs this header? this is realy confusing.Calces
Take a good look at the documentation, I think the information you are looking should be there. I don not have any experience with mysql under windows, so I have a hard time giving you better advice then to read the manual.Catechist
L
3

Some pointers to installing mysql header libraries are found here :

https://github.com/jeffreyhorner/RMySQL

(site seems to have moved here now)

http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

Key is to have a Renviron.site file in the R\etc folder and having libmysql.dll in the correct places before compiling from source.

good luck.

Libava answered 29/6, 2012 at 13:12 Comment(0)
S
2

You will never get a RMySQL precompiled binary package for Windows, because before installing it checks for validity of the MySQL path & other include files.

Sporophyll answered 14/10, 2012 at 1:9 Comment(0)
O
1

I had this same issue. What I found out was that installer was placing temp files in my default working directory which I had edited in the Rprofile.site file. When it tried to subsequently use these files (including mysql.h) it could not find them. When I restored the Rprofile.site file to default, everything worked nicely. Hopefully this helps if nothing else did.

Orvah answered 11/4, 2015 at 14:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.