I can connect to a database using
dbConnect(m, dbname="intSites",user="3y996DKX7i",password="pass")
but when I try using
dbConnect(m, default.file="mysql.config")
and similar calls I get an error: RS-DBI driver: (Failed to connect to
database ...
Details follow. Please forgive a few line wraps. Help appreciated.
Chuck
---
# here is 'mysql.config' in getwd()
readLines("mysql.config")
<MySQLDriver:(82181)>
Driver name: MySQL
Max connections: 16
Conn. processed: 0
Default records per fetch: 500
Open connections: 0
# connecting with dbname,user,password WORKS OK
con <- dbConnect(m, dbname="intSites",user="3y996DKX7i",password="pass")
summary(con)
<MySQLConnection:(82181,0)>
User: 3y996DKX7i
Host: localhost
Dbname: intSites
Connection type: Localhost via UNIX socket
No resultSet available
# but using default.file seems to fail
con2 <- dbConnect(m, default.file="mysql.config")
Error in mysqlNewConnection(drv, ...) :
RS-DBI driver: (Failed to connect to database: Error: Can't connect to
local MySQL server through socket '/tm\
p/mysql.sock' (2)
)
# try again, but specify group
con2 <- dbConnect(m, group="client", default.file="mysql.config")
Error in mysqlNewConnection(drv, ...) :
RS-DBI driver: (Failed to connect to database: Error: Can't connect to
local MySQL server through socket '/tm\
p/mysql.sock' (2)
)
Error in mysqlNewConnection(drv, ...) :
RS-DBI driver: (Failed to connect to database: Error: Can't connect to
local MySQL server through socket '/tm\
p/mysql.sock' (2)
)
sessionInfo()
R version 2.9.0 (2009-04-17)
i386-apple-darwin8.11.1
locale:
C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RMySQL_0.7-4 DBI_0.2-4
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901