将闪亮的应用程序连接到服务器上的 mysql 数据库 [英] connecting shiny app to mysql database on server
本文介绍了将闪亮的应用程序连接到服务器上的 mysql 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以帮助如何将闪亮的 mysql 数据库连接到服务器上.我可以在我的系统上进行本地连接,但我们如何在服务器上进行相同的操作以使其在线可用
can anyone help on how t connect a shiny with mysql database on server. I can do the connection locally on my system but how can we do the same on server to make it available online
推荐答案
从 R 控制台安装下面的包
Install below package from R console
install.packages("RMySQL", dependencies = TRUE)
install.packages("RMySQL", dependencies = TRUE)
您可以通过以下方式访问 mysql 数据库:
And you can cennect mysql database as below:
server.R 中的代码:
library(RMySQL)
options(mysql = list(
"host" = "127.0.0.1",
"port" = 3306,
"user" = "myuser",
"password" = "mypassword"
))
databaseName <- "DATABASE NAME"
table <- "TABLE"
希望它能帮助您将您的应用程序连接到 mysql 数据库.如果您仍然需要帮助,请告诉我 :)
Hope it will help you to connect your application with mysql database. If you still need help let me know :)
这篇关于将闪亮的应用程序连接到服务器上的 mysql 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文