Shinyapps.io MySQL database

Hi,

I have deployed a shiny app on shinyapps.io that analyses data from MySQL database. The applications uses the "pool" package and "dbpool" connection string to connect to the MySQL database. The application works very fine on my local computer. However, after uploading to shinyapps.io, the displayed url only shows the message "ERROR: An error has occurred. Check your logs or contact the app author for clarification."

Please could anybody help me with why the application runs fine on my local computer, but I get this error when I try to deploy it. Thanks in advance.

regards,

Rueben

What the logs say? we need this information to help you.

Hi Anders,

Thanks for your response. I have attached the logs in the pdf file. It seems to be complaining about the connection to MySQL database. I have also attached the ipconfig from the command prompt to show my public ip address. Please help. Thanks very much.

logs-shinyApp.pdf (79.7 KB)

It seems to be trying to connect to a local Mysql instance (on the shinyapps.io server) instead of your Mysql server, can you show how are you making the connecting in your script? Also have in mind that you have to configure your Mysql server to allow remote connections (from the shinyapps.io server) and the IP you are showing in your screenshot are local IPs not a public one.

Hi Andres,

Please find attached a pic of my connection string to MySql database in the script. It uses the "pool" package and "dbPool" function. The connection works well on my local computer. I have also attached a picture of my public ip address obtained from "https://www.whatismyip.com/". Please, do you have any instructions on how to configure Mysql server to allow remote connections, if that is the problem? Thanks for the help.

I have hiden your screenshot, openly showing your public IP on a forum is not a good idea.
About your connection code, you are using host = localhost, this will only work locally, if you want to shinyapps.io to connect to your server you have to use your public IP instead and make sure you have port forwarding configured so the request reaches your Mysql instance
Unfortunately, the specifics of how to configure this are very system dependent so I can't give you any specific advice (besides being beyond the scope of this forum).

Hi Andres,

Thanks for your response.

I have configured the port forwarding as explained in the answer in the link below and everything looks fine

I have also used the public ip address as you suggested. I however get the error in the attached log file. It is complaining about connection to mysql server using the public ip addresslogs.pdf (75.1 KB) .

I have also attached a picture of the connection string in the R

code. Please help me.

The deployed shiny app is not being able to connect to your Mysql instance so if you have configured your Mysql server to allow remote connections, then it means your port forwarding is not working properly, anyways, this is more related to your network and Mysql server configuration than it is to shiny, so maybe you would have better luck asking this part of your issue on a Mysql forum.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.