连接数据库SQL与RStudio

3
我将开始一个新项目 ==> 通过Rstudio进行数据可视化。 我的数据存储在服务器上的phpMyAdmin(SQL数据库)中。 我只会使用4个表格,所以在这种情况下,我需要在我的数据库和Rstudio之间建立链接。我在Stackoverflow上找到了这个问题:enter link description here 我试过这个解决方案,首先安装了mySQL包,但是返回了错误:package ‘mysql’ is not available (for R version 3.2.2)
请注意,我正在使用PalantirCloud。
您能否给我建议如何解决这个问题?谢谢。

1
你是使用本地服务器还是远程服务器? - Ashiqur Rahman
@AshiqurRahman 远程服务器 - vero
1个回答

3
将远程MySQL服务器的所有权限授予特定的(数据库)用户。
然后在Rstudio中运行以下命令。
install.packages("RMySQL")

library("RMySQL")

mydb = dbConnect(MySQL(),user='root',password='query',dbname='bd_test', host='192.X.X.X')

在哪里 -

User = Remote MySQL database username
Password = Remote MySQL database user's password
dbname = Remote database name
And Host = The Remote server URL/IP address

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接