how to install RMySQL on CentOS

A quick note for who have the need of installing RMySQL on CentOS (or RHEL).

On my system R is installed via the EPEL repository (as I’ve added in the comments of this post of this very blog).

Given this I went to the RMySQL project page and downloaded both the RMySQL_0.7-5.tar.gz and the (required) DBI_0.2-5.tar.gz packages.

This because installing the R-DBI package provided by the activated repository on my system gave me errors during the actual RMySQL installation.

So, as root – since the installation was needed system-wide – i gave those two following commands:

[root@testing ~]# R CMD INSTALL DBI_0.2-5.tar.gz
[root@testing ~]# R CMD INSTALL RMySQL_0.7-5.tar.gz

Then all the user needed to do was loading into his R environment the new modules!
Happy coding!

For future reference:

  • CRAN – RMySQL package
  • CRAN – DBI package

2 thoughts on “how to install RMySQL on CentOS

  1. Today I’ve installed the 0.8-0 release on a freshly installed machine. Be sure to have installed the mysql-devel package before issuing the R CMD INSTALL RMySQL**** command…


  2. Your tutorial was very helpful. Just one issue that should be pointed out that one should have installed mysql-devel (yum install mysql-devel) since RMySQL looks for the MySQL headers and on 64 bit centos declare the following variable
    export PKG_CPPFALGS=”-I/usr/include/mysql”
    export PKG_LIBS=”-L/usr/lib64/mysql -lmysqlclient”
    .. and also install the make package (yum install make).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.