title: How to sync ShinyApps with MySQL From Localhost to Public
body: <p>I am currently developing an app using R Shiny and finishing my ShinyApps, now I am trying to deploy the apps to <strong>Shinyapps.io</strong> so multiple user can reach and use it, but I have an issue for the deployment.</p>
  
  <p>my Apps is about a Pharmacy management, it controls a CRUD operation, so clearly it is binded with db Connection using these options configuration (running this in locally)</p>
  
  <pre><code>options(mysql = list(
  "host" = "127.0.0.1",
  "port" = 3306,
  "user" = "root",
  "password" = ""
  ))
  </code></pre>
  
  <p>one more thing, to connect to database, I usually started my XAMPP apps and switched on mysql admin so my apps can connect the database locally. it worked flawlessly and clear before deploy</p>
  
  <p>but it crashed instantly when I try to run it in the shiny.io after delpoy (what I mean is <strong>disconnected automatically</strong>). so I did try to change the host ip to publically like this , (I am trying to get ip address on user local machine)</p>
  
  <pre><code>configA &lt;- system("ipconfig", intern=TRUE)
  configB &lt;- configA[grep("IPv4", configA)]
  configC &lt;- gsub(".*? ([[:digit:]])", "\1", configB)
  
  options(mysql = list(
  "host" = configC,
  "port" = 3306,
  "user" = "root",
  "password" = ""
  ))
  </code></pre>
  
  <p>the ConfigC variable stores IPv4 address to get the public IP on local machine, but still these doesn't work, I attached a log in below link </p>
  
  <p><strong>how can I connect and sync my apps with MySQL in Shinyapps.io ?</strong> I use DBI and RMySQL package..do I need to host MySQL first so i can sync my apps? can anyone brief me with step by step explanation how to? thankyou in advance</p>
  
  <p><strong>here is my error log from shinyapps.io</strong>
  <a href="http://textuploader.com/dulzh" rel="nofollow noreferrer">http://textuploader.com/dulzh</a></p>