RDS AWS timing out

I can connect to mySQL server hosted on AWS with jupyter no problem but cannot connect via streamlit sharing app. Any ideas would be appreciated. Here is the code relevant to the connection:

from sqlalchemy import create_engine
import pandas as pd

conn = create_engine('mysql+pymysql://' + user + ':' + password + '@' + host + ':' + str(port) + '/' + 
dbname , echo=False)

dfTable = pd.read_sql("SELECT * FROM vario", conn)

Hi @seanhoran, welcome to the Streamlit community!

If this is a company instance, you might need to ensure that external traffic is allowed to the MySQL database. It’s frequently the case that cloud databases are only available via the local company network per the firewall.

Additionally, while this will be supported in the future, secrets management is not yet publicly released in Streamlit sharing. So I highly recommend you don’t have your secrets in your Python script as you are showing, as your GitHub repo will be publicly available on the internet.


Thanks @randyzwitch.

Sounds like I am out of luck then. Looking for an way to show live results of a quiz from multiple users.

If you have an idea for different work around that would be great!