我制作了一个示例闪亮的应用程序,该应用程序与在本地主机上运行的SQL Server连接。我在shinyapps.io中创建了一个免费帐户,当我尝试将其部署到该帐户时,出现错误“无法从服务器加载”
library(shiny)
library(shinydashboard)
library(RMySQL)
library(lubridate)
library(DBI)
con_iris <- DBI::dbConnect(
drv = RMySQL::MySQL(),
dbname = "iris_db",
host = "localhost",
username = "XXXX",
password = "XXXXXX"
)
ui<-shinyUI(fluidPage(
#fluid page for dynamically adapting to screens of different resolutions.
titlePanel("Iris Dataset"),
sidebarLayout(
sidebarPanel(
selectInput("select", label = h5("select species"),choices = c("setosa"=1, "Vericolor"=2, "virginica"=3),
selected = 1)
),
mainPanel(
textOutput("data")
)
)
))
server<-shinyServer(function(input, output) {
#referring output distPlot in ui.r as output$distPlot
output$data <- renderText({
query<-paste0("select * from iris where Species= '", input$select , "'", sep='')
species<-dbGetQuery(con_iris, query)
})
})
shinyApp(ui=ui,server=server)
任何人都可以帮我喜欢在code / shinyapps.io帐户中需要做的所有程序更改吗。。。以部署闪亮的应用程序并从本地托管在我的计算机中的sql服务器中获取数据...因为我无法采取任何适当的步骤来连接我的本地服务器...在此方面非常需要帮助... !!!