Streamlit deployed app connection to my local database

My database is local(MySQL), and my streamlit app is a feedback form.
My requirement: I want to save the response from users (who have my streamlit apps link )to my local database.
How can I establish the above connection.
If I require to host my local db to public how can i do that?

Hi @Ebin_Varghese, welcome to the Streamlit community!

In general, you never want your home computer receiving internet traffic unless you really know what you’re doing. In most cases, internet providers make it near impossible to do this, since it opens up your computer to malicious actors.

If you are using MySQL locally to develop, then hosting a mirror of that database on a public cloud such as Heroku or DigitalOcean (or AWS, Google Cloud, etc) is your best best. In that case, you would either use a credential manager where your app is being deployed, or if on Streamlit Cloud, use st.secrets to keep your credentials secure.

Best,
Randy

Thanks your comment really helped