$Id$ 1. LINUX/MAC Installation: R CMD INSTALL [-l] RMySQL_.tar.gz During installation, RMySQL looks for the MySQL headers and libraries in the system directories. If these are not installed in system-wide directories (or if you want to use an alternate MySQL distribution), you may specify which MySQL directory(ies) to use through one of the following: 1. The shell variables PKG_CPPFLAGS and PKG_LIBS (using Bourne shell) export PKG_CPPFLAGS="-I" export PKG_LIBS="-L -lmysqlclient" For instance, on some 64 systems (e.g., Linux) you may need to set export PKG_CPPFALGS="-I/usr/include/mysql" export PKG_LIBS="-L/usr/lib64/mysql -lmysqlclient" or 2. Use the RMySQL configuration shell variables export MYSQL_INC=" export MYSQL_LIB=" You may also specify the base directory (this is the directory that has sub-directories "lib/mysql" and "include/mysql" directories) export MYSQL_DIR="" or 3. Use the --with-mysql-* RMySQL configuration arguments --with-mysql-dir= --with-mysql-inc= --with-mysql-lib= e.g., R CMD INSTALL --configure-args="--with-mysql-dir=$HOME/mysql" ... Also, besure that RMySQL can find the non-system libraries at run-time. This is typically managed by an environment variable (LD_LIBRARY_PATH or DYLD_LIBRARY_PATH for OSX) or the /etc/ld.so.cache. S/W Requirements: ----------------- MySQL client library ("libmysqlclient.so") and header files (see www.mysql.com). For Linux/intel you may use the binary rpms client+devel+shared, and make sure you also have the header files, they are *NOT* included in the following MySQL-client-4.1.7-1.i386.rpm MySQL-shared-4.1.7-1.i386.rpm but they are included in the latest 4.1.7 rpm versions. The library libz. This is a standard library on many (but not all) systems. Under Red Hat, it's included in the rpm zlib-devel. I've been told that on debian it's in the zlib1g-dev package. Testing MySQL ------------- This section is for users who wish to test RMySQL itself. Most users will not need this. To run tests in the tests directory, set MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE, to appropriate values. If MYSQL_USER and MYSQL_PASSWORD are missing then it assumes that user and password have been set in the MySQL option files -- typically my.cnf (or my.cnf or my.ini on Windows) but see: http://dev.mysql.com/doc/refman/5.1/en/option-files.html If MYSQL_DATABASE is unspecified it defaults to "test". 2. WINDOWS You need to have installed 'C Include Files / Lib Files' as part of your MySQL installation when installing the MySQL binary distribution. Then just set MYSQL_HOME to point to the top of the MySQL installation and install via Rcmd INSTALL in the usual way. (Note that when running MySQL, as opposed to installing it, do not need to set MYSQL_HOME if its in a place it can find such as registry, %ProgramFiles%\MySQL, C:\MySQL, C:\xampp\MySQL, C:\Apps\MySQL or the same directories on other disks.) e.g. assuming that MySQL is installed in the indicated location you might enter this into the Windows command line (not into R): set MYSQL_HOME=C:\\Program Files\\MySQL\\MySQL Server 5.1 R CMD INSTALL RMySQL_*.tar.gz where RMySQL_*.tar.gz is replaced with the source tar.gz file name. Note that unless you have MySQL in a non-standard place you only need to set MYSQL_HOME while installing it but not for running it. If its in a non-standard place where it can't find it then MYSQL_HOME should be set to run RMySQL as well. Also see the Testing MySQL under Linux/Mac above if you wish to test RMySQL itself.