即使MySQL客户端CLI正常运行,RMySQL连接也不起作用

时间:2018-12-03 22:18:52

标签: r rmysql

我在~/.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

0 个答案:

没有答案