【发布时间】:2018-04-06 14:40:20
【问题描述】:
您好,我正在尝试使用以下代码将 R 连接到 MySQL 数据库。
library(RMySQL)
library(dbConnect)
con<-dbConnect(dbDriver('MySQL'),user='root',password='pw',dbname='dbname',host='100.000.0.00')
(参数是假的)
R 返回以下错误:
Error in .local(drv, ...) :
Failed to connect to database: Error: Lost connection to MySQL server at 'handshake: waiting for inital communication packet', system error: 138
我已经尝试使用 Heidi 来丰富数据库并且它工作正常。我不明白为什么使用 R 不起作用。有什么建议吗?
【问题讨论】:
-
不工作!!!
标签: mysql r rmysql dbconnection