Successfully installed RMySQL under win7

  
 

Learning R language, I want to get the data on mysql database through RMySQL, but installing RMySQL often can't be installed successfully at one time, sometimes it will be entangled for a few hours, even a few days, like I got entangled for one night, according to The following steps were successfully installed 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.

Steps:

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

2. Installation 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 R and Rtools Directory to the environment variable PATH: F:\\Program Files\\R\\R-3.0.0\\bin\\x64; F:\\Rtools\\bin;F:\\Rtools\\gcc-4.6.3\\bin;

3. Install the RMySQL dependency package "DBI”Open R x64 3.0.0, run install.packages('DBI')

4. Download RMySQLinstall.packages('RMySQL', type='source') installation Procedure prompt "ERROR: configuration failed for package 'RMySQL'". First, remember the package to save the saved directory

5. At F:\\Program Files\\R\\R-3.0.0\\etc Create a file under the folder Renviron.siteMYSQL_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 D: \\Program Files\\MySQL\\MySQL Server 5.5\\lib folder, create a new folder opt, and copy libmy Sql.dll and libmysql.lib to the opt folder

7. Copy libmysql.dll to D:\\Program Files\\MySQL\\MySQL Server 5.5\\bin

8. Open the command line cmd .exe, enter the following command to install: R CMD INSTALL "< package download directory>/RMySQL_0.9-3.tar.gz"

to install successfully.

Installation failure Possible reasons: 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 already included in the environment variable PATH, if no need to manually add it. 3. Run install.packages('RMySQL', type='source') directly. The installation is unsuccessful. You need to use R CMD INSTALL to install it on the command line.

Copyright © Windows knowledge All Rights Reserved