RMySQL is a database interface and MySQL driver for R.
This version complies with the database interface
definition as implemented in the package DBI 0.2-2.
The latest version will always be available here:
http://cran.r-project.org/web/packages/RMySQL/index.html
But until it has updated, you can get the source for
RMySQL 0.7-4 here:
Windows Support and Binaries
Starting with
RMySQL 0.7-2, the libmySQL.dll provided by MySQL is no longer distributed with
RMySQL. You must obtain the correct version directly from MySQL:
http://www.mysql.com/
Please install the correct version of MySQL before downloading one of the following supported
RMySQL binaries:
MySQL 5.0.67: Available on CRAN in a few days
MySQL 5.1.33:
RMySQL_0.7-4.zip MD5: 28acb91382f2027b4286407fe16c1f71
These were compiled on Microsoft Windows 2000 SP4 with R 2.8.1 and Rtools29.
Two Ways for RMySQL to find libmySQL.dll
You must choose one of the two ways below for
RMySQL to properly work.
By Setting MYSQL_HOME
When you install MySQL, set the MYSQL_HOME environment variable to the folder where MySQL was installed. Also you may need to use
the short names of the non-8dot3 file name format for R to properly interpret the folder path. For instance, presuming you installed both MySQL 5.0 and MySQL 5.1 (as I did for building the binary packages) typing this at the command prompt will set MYSQL_HOME to the MySQL 5.0 folder:
set MYSQL_HOME=C:\PROGRA~1\MySQL\MYSQLS~1.0
By Searching the Registry
When you install the full MySQL distribution (I chose the "Windows Essentials" download option with the "Complete" install option), meaning that you installed the server as well as the client programs and libraries, MySQL will store version and location info into the Windows Registry.
RMySQL can use this information to find the proper libmySQL.dll. For instance, notice the following R code and its output:
> readRegistry("SOFTWARE\\MySQL AB", hive="HLM", maxdepth=2)
$`MySQL Server 5.0`
$`MySQL Server 5.0`$FoundExistingDataDir
[1] "0"
$`MySQL Server 5.0`$Location
[1] "C:\\Program Files\\MySQL\\MySQL Server 5.0\\"
$`MySQL Server 5.0`$Version
[1] "5.0.67"
$`MySQL Server 5.1`
$`MySQL Server 5.1`$DataLocation
[1] "C:\\Documents and Settings\\All Users.WINNT\\Application Data\\MySQL\\MySQL Server 5.1\\"
$`MySQL Server 5.1`$FoundExistingDataDir
[1] "1"
$`MySQL Server 5.1`$Location
[1] "C:\\Program Files\\MySQL\\MySQL Server 5.1\\"
$`MySQL Server 5.1`$Version
[1] "5.1.30"
If you get the above output, there's nothing more you need to do as
RMySQL will find the first
Location in the list above. In this case MySQL 5.0 is chosen.
Older Windows binaries which are no longer supported