[R] RMySQL connection

R.Alberts r.alberts at biol.rug.nl
Thu Oct 28 14:05:31 CEST 2004


The problem has been solved. I didnt install the mysql 
libraries and header files properly.

To solve it, I installed:
MySQL-client-4.1.7-0.i386.rpm
MySQL-server-4.1.7-0.i386.rpm
AND
MySQL-devel-4.1.7-0.i386.rpm  (libraries and header files)

then I installed RMySQL using:

export PKG_CPPFLAGS="-I/usr/include/mysql"
export PKG_LIBS="-L/usr/lib/mysql -lmysqlclient"

R CMD INSTALL -l /usr/local/lib/R RMySQL_0.5-5.tar.gz


thanks, Rudi.


On Thu, 28 Oct 2004 06:03:46 -0400
  Sean Davis <sdavis2 at mail.nih.gov> wrote:
> 
> On Oct 28, 2004, at 4:37 AM, R.Alberts wrote:
> 
>> Hi,
>>
>> I cannot connect to my mysql database from within R 
>>using RMySQL. What 
>> am I doing wrong?
>>
>> I use linux SuSe 8.1 and R-2.0.0
>> RMySQL_0.5-5.tar.gz
>> DBI_0.1-8.tar.gz
>>
>> I get the following error in R:
>>
>>> library(RMySQL)
>> Loading required package: DBI
>>> m <- dbDriver("MySQL")
>>> m
>> <MySQLDriver:(1756)>
>>> con <- dbConnect(m, group = "mygroup")
>> Error in mysqlNewConnection(drv, ...) : RS-DBI driver: 
>>(could not 
>> connect myuser at localhost on dbname "mydatabase")
> 
> On the mysql server, there is a user named myuser?  The 
>password for this user is xxxxxx (or whatever)?  The 
>database is called mydatabase?  The host for the server 
>is localhost (mysql is running on the same machine as R)? 
> That user/password combination has access to mydatabase?
> 
> Can you connect from the mysql client on the same 
>machine with those settings?
> 
> Sean
>




More information about the R-help mailing list