Folks, I failed to create a connection to the database under MySQL DBMS in the R system via RMySQL's method dbConnection(...). My setup is as follows: Microsoft Windows XP 5.1.2600 MySQL 4.1.9 R 2.0.1 DBI 0.1-8 RMySQL 0.5-5 Both of DBI and RMySQL packages were downloaded from bell lab: http://stat.bell-labs.com/RS-DBI/download/index.html My case in R is as follows:> library(DBI) > library(RMySQL) > mgr <- dbDriver("MySQL") > con <- dbConnect(mgr, user="root", pass="*******", host="localhost", dbname="campus")Error in mysqlNewConnection(drv, ...) : RS-DBI driver: (could not connect root at localhost on dbname "campus") What am I doing wrong with?... It is really an annoying question. Thank you very much for your help and patience. Yours truly, Willie Y CHEN -- ************************************ Decisioneering Pty Ltd PO Box 23 Doncaster, VIC 3108 Australia O: +61-3-98558661 H: +86-21-64205688
> My setup is as follows: > > Microsoft Windows XP 5.1.2600 > MySQL 4.1.9 > R 2.0.1 > DBI 0.1-8 > RMySQL 0.5-5 > > [...] > > > dbname="campus") > Error in mysqlNewConnection(drv, ...) : RS-DBI driver: (could > not connect root at localhost on dbname "campus") > > What am I doing wrong with?... It is really an annoying question. > Thank you very much for your help and patience.Make sure your MySQL server accepts pre-4.1-style passwords for the user you log on with (cf. http://dev.mysql.com/doc/mysql/en/old-client.html). The MySQL library included in RMySQL 0.5-5 comes from the 4.0.18 distribution and uses an old authentication protocol that isn't compatible with the one implemented in MySQL 4.1.x. Hope this helps. Michael
On Sat, 29 Jan 2005 14:53:55 +0800, Willie Y. CHEN <chenyong.cn at gmail.com> wrote:> Folks, > > I failed to create a connection to the database under MySQL DBMS in > the R system via RMySQL's method dbConnection(...). > > My setup is as follows: > > Microsoft Windows XP 5.1.2600 > MySQL 4.1.9 > R 2.0.1 > DBI 0.1-8 > RMySQL 0.5-5 > Both of DBI and RMySQL packages were downloaded from bell lab: > > http://stat.bell-labs.com/RS-DBI/download/index.html > > My case in R is as follows: > > > library(DBI) > > library(RMySQL) > > mgr <- dbDriver("MySQL") > > con <- dbConnect(mgr, user="root", pass="*******", host="localhost", dbname="campus") > Error in mysqlNewConnection(drv, ...) : RS-DBI driver: (could not > connect root at localhost on dbname "campus") > > What am I doing wrong with?... It is really an annoying question. > Thank you very much for your help and patience. > > Yours truly, > > Willie Y CHEN > --Check RMySQL docs for how to use the .my.cnf file to make the connection. We could not do it inline either, but when we put the info into the file RMySQL worked fine. See page three here: http://cran.r-project.org/doc/packages/RMySQL.pdf jab -- John Bollinger, CFA, CMT www.BollingerBands.com If you advance far enough, you arrive at the beginning.