I am having trouble connecting to my AWS RDS database from within my R shiny app on a different AWS EC2 instance.
I can connect no problems from Rstudio on my computer, however when I use the same code on the EC2 instance, it does not connect, receiving this error:
Error in .local(drv, ...) : Failed to connect to database: Error: Can't connect to MySQL server on '***rds.amazonaws.com' (110 "Connection timed out")
My code is:
db = dbConnect(MySQL(), user='***', password='***', dbname = '***', host='***', port = 3306)
I have tried these solutions with no success:
There was another similar solution to above using a different package (dbplyr?) which also didn't work and can't refind the link.
Could not figure out how to implement this solution, the problem seems very similar:
It seems other people have experienced this issue, but I can't seem to find a solution online.