How can I create a plot in a Shiny Dashboard using data from MySql Database?

I'm working on a sample dashboard in R in which I've to create a chart based on the selection of the user from the dropdown menu. Now I've established a connection with the database and I've hardcoded the values in the dropdown menu.

Now I want to plot a chart based on the selection of the user from these dropdown menus. The dropdown menus

Now I need to create a chart based on the users selection. How can I do this.

library(shiny)
library(shinydashboard)
library(dbConnect)
library(RMySQL)
library(DBI)
library(foreign)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(
        sidebarSearchForm(textId = "searchText", buttonId = "searchButton",
                    label = "Search..."),

        selectInput("Filter1", "Device Brand",
                  choices = c('HTC', 'Asus', 'Lenovo', 'Samsung', 'Acer', 'Xiaomi', 'Oppo', 'Vivo', 'Oneplus', 'Motorola', 'YU', 'Sony', 'Lava', 'LeMobile',
                  'LGE', 'Sony Ericsson', 'InFocus', 'Nokia', 'Foxconn International Holdings Limited', 'HUAWEI', 'Coolpad', 'iBall', 'TCL', 'TrendMicro',
                  'Micromax', 'Letv', 'LYF')),

        selectInput("Filter2", "Device SDK:",
                  choices = c('19', '22', '21'))
  ),
  dashboardBody(
# Boxes need to be put in a row (or column)
    fluidRow(
      box(plotOutput("plot1", height = 250)),
      box(
        title = "Controls",
        sliderInput("slider", "Number of observations:", 1, 100, 50)
      )
    )
  )
)

server <- function(input, output) {

conn <- dbConnect(
    drv = RMySQL::MySQL(),
    dbname = "apilogs",
    host = "localhost",
    username = "root",
    password = "root")
rs <- dbSendQuery(conn, "SELECT * FROM Eventlog;")
data1 <- dbFetch(rs)

    data1$device_brand <- strptime(data1$device_brand, '%X')



    set.seed(122)
    histdata <- rnorm(500)

    output$plot1 <- renderPlot({
        data <- histdata[seq_len(input$slider)]
        hist(data)
    })
}

shinyApp(ui, server)