Successfully installed RMySQL

  
under win7

Learning R language, want to get data on mysql database through RMySQL, but installing RMySQL often can not be installed once, sometimes it will be entangled for hours, even days, like I tangled for one night To get it, follow the steps below and install it successfully in the RStudio R (PS: Recommended RStudio Software) language integration development environment. I also found a lot of posts before I installed it successfully on Win7 system.

Specific steps:

1. Install R-3.0.0 (installation directory: F:Program FilesRR-3.0.0)

2. Install Rtools (installation directory: F:Rtools)

Rtools download address http://cran.r-project.org/bin/windows/Rtools/(find the corresponding version of Rtools installation)

This step is very important Add the R and Rtools directories to the environment variable PATH: F:Program FilesRR-3.0.0binx64;F:Rtoolsbin;F:Rtoolsgcc-4.6.3bin;

3. Install the RMySQL dependency package“DBI”< Br>

Open R x64 3.0.0 and run install.packages(DBI)

4. Download RMySQL

install.packages(RMySQL, type=source)

Installation procedure prompt "ERROR: configuration failed for package RMySQL".

Don't care, remember to download the saved directory

5. In the F:Program FilesRR-3.0.0etc folder Create the file Renviron.site

MYSQL_HOME="D:/Program Files/MySQL/MySQL Server 5.5"

(Note that if the path contains spaces, it must be enclosed in double quotes)

6. In the D:Program Files MySQLMySQL Server 5.5lib folder, create a new folder opt and copy libmysql.dll and libmysql.lib to the opt folder.

7. Copy libmysql.dll to D:Program FilesMySQLMySQL Server 5.5bin

8. Open the command line cmd.exe and enter the following command to install:

R CMD INSTALL "<pack download directory>/RMySQL_0.9-3.tar. Gz"

will install successfully.

Installation Failure Possible Cause:

1. Check if the MYSQL installation directory contains spaces. For example, the contents of the Renviron.site file must be quoted in double quotes.

2. Check if the bin directory of R and RTools is included in the environment variable PATH, if no need to manually add it.

3. Running install.packages (RMySQL, type=source) directly is unsuccessful. You need to use R CMD INSTALL to install it from the command line.

Copyright © Windows knowledge All Rights Reserved