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)
Can anyone help me like what are all the procedural changes that needs to be done in the code/shinyapps.io account....to deploy the shiny app and fetch data from the sql server which is hosted locally in my machine...because i couldn't any proper steps to connect with my local server...reallly need help in this guys...!!!