我在~/.my.cnf
客户端上有一个有效的mysql
文件。我也想将其与RMySQL包一起使用,但失败了。更糟糕的是,我什至无法获得具有完整连接信息的基本连接。
尝试了各种建议的技巧。
> library(RMySQL)
Loading required package: DBI
> dbconn <- dbConnect(MySQL(), group = 'mysql')
Error in .local(drv, ...) :
Failed to connect to database: Error: Access denied for user 'blah'@'a.b.c.d' (using password: YES)
> dbconn <- dbConnect(RMySQL::MySQL(), groups = 'mysql')
Error in .local(drv, ...) :
Failed to connect to database: Error: Access denied for user 'blah'@'a.b.c.d' (using password: YES)
> dbconn <- dbConnect(RMySQL::MySQL(), dbname = 'master', host = 'my-host-name', port = 3306, user = 'blah', password = 'junk')
Error in .local(drv, ...) :
Failed to connect to database: Error: Access denied for user 'blah'@'a.b.c.d' (using password: YES)
> packageVersion('RMySQL')
[1] ‘0.10.15’
我的~/my.cnf
如下所示,并且可以与mysql
客户端正常工作:
[mysql]
user=blah
password=junk
host=my-host-name
port=3306
database=master