Successful installation of Rmysql under Win7

Source: Internet
Author: User

Learn R language, want to get the data on the MySQL database through Rmysql, but the installation rmysql often can not be one-time installation success, sometimes entangled on a few hours, or even a few days, like I tangled up a night just to fix, follow the steps below, in Rstudio R (PS: Recommended Rstu Dio software) A successful installation in the language integration development environment. It was also a lot of posts before it was successfully installed on the 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 the corresponding version to rtools installation)

This step is important to add R and Rtools directories to the environment variable Path:f:program filesrr-3.0.0binx64; F:rtoolsbin; F:rtoolsgcc-4.6.3bin;

3. Install Rmysql Dependency Pack "DBI"

Open R x64 3.0.0, run install.packages (' DBI ')

4. Download Rmysql

Install.packages (' Rmysql ', type= ' source ')

The installation process prompts "Error:configuration failed for package ' rmysql '."

No matter what, remember the package download the saved directory

5. Create a file under the F:program filesrr-3.0.0etc folder

Mysql_home= "D:/program files/mysql/mysql Server 5.5"

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

6. Under D:program filesmysqlmysql Server 5.5lib folder, create new folder opt, and copy Libmysql.dll and libmysql.lib to 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 "< package download directory >/rmysql_0.9-3.tar.gz"

can be installed successfully.

Possible reasons for installation failure:

1. Check the MySQL installation directory contains spaces, if the contents of the file must be quoted in double quotes.

2. Check if the bin directory for R and Rtools is included in the environment variable path, if there is no need for manual additions.

3. The direct operation of Install.packages (' Rmysql ', type= ' source ') is not successful and needs to be installed on the command line using R CMD install.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.