我在RStudio Server上运行了一个脚本。我想将我的RSTudio连接到另一个服务器(我的localhost)中存在的MySQL数据库,我使用了以下这些行:
library(RMySQL)
mydb = dbConnect(MySQL(), user='myusername', password='mypasswd', dbname='my_db', host='IP of the server in which mysql exists')
但我有这个错误:
Error in .local(drv, ...) :
Failed to connect to database: Error: Can't connect to MySQL server on 'IP of the server in which mysql exists' (110)
在MySQL服务器中,我将权限授予托管我的RStudio服务器的服务器:
grant all privileges on *.* to remoteuser@IPofRStudioServer identified by "userpassword";
我在/etc/mysql/my.cnf
中评论了这一行:
bind-address = 127.0.0.1
你能帮帮我吗?