Using the RMySQL package under Windows
If you install the RMySQL package for Windows in the usual
way, when you try to load it, you'll probably see an error message
like the following:
> library(RMySQL)
Loading required package: DBI
Error in utils::readRegistry("SOFTWARE\\MySQL AB", hive = "HLM", maxdepth = 2) :
Registry key 'SOFTWARE\MySQL AB' not found
Error : .onLoad failed in 'loadNamespace' for 'RMySQL'
Error : package/namespace load failed for 'RMySQL'
To fix this problem, first download http://www.stat.berkeley.edu/~spector/s133/libmySQL.dll
to your computer, and navigate to the installation directory for the
RMySQL package. It should be in
c:\Program Files\R\R-2.10.1\library\RMySQL, although if you're using
a different version of R, the pathname may be slightly different. In this
folder, create a new folder named "bin" (without the quotes), and
move the libmySQL.dll file to this new folder. Now, use the
following commands to load the package:
> Sys.setenv(MYSQL_HOME='c:/Program Files/R/R-2.10.1/library/RMySQL')
> library(RMySQL)
If you see a warning message about the version of MySQL that's
being used, there's a good possibility that R will crash when you try
to use the library. This should only happen if you're running a version
of R older than R-2.10.1.
Note for Vista Users: It appears that Vista installs R packages in a
user directory, instead of the Program Files folder. If this is the case
on your computer, the pathname to the RMySQL folder will be of the form
c:\Users\username\Documents\R\win-library\2.10\RMySQL
where
username is the user name that you use to log in to your computer.
Thus, you would use that path in the above instructions, instead of
c:\Program Files\R\R-2.10.1\library\RMySQL.
If this method doesn't work, you can download an older version of the
package here: http://www.stat.berkeley.edu/~spector/s133/RMySQL_0.5-11.zip. In R, use
Packages -> Install Package(s) from local zip files... to install this
version of the package. There will be some warning messages, but the
functionality should not be affected. One downside to this approach is that
the help files for the functions in the package will not be available.
File translated from
TEX
by
TTH,
version 3.67.
On 31 Mar 2010, 15:03.