Deploying app with local database

Hello guys,

Is it possible to deploy and share a web app using data from a local MySQL database on my home machine?

My idea is to build an app with real-time analytics using data from a MySQL database that is constantly updated.

My current understanding is that I need to upload the data (e.g. csv-file) to GitHub as well and fetch the data from there.

Would be nice if you could let me know the best practice in order to do real-time analytics with streamlit.

Thank you in advance!

Hi @Baili, welcome to the Streamlit community!

Opening your local machine up to the internet is generally not possible, or at least not advised. Whether you can host a database locally and make it publicly available will be a function of whether your internet provider allows this sort of functionality (through static IP addresses, opening firewall ports, etc.)

From a Streamlit perspective, Streamlit sharing will have secrets management released in about a month or so. This will allow you to have your passwords securely managed via the Streamlit sharing interface, without having your credentials in your publicly-available code. So shortly, yes, you will be able to securely access a database from Streamlit.



Thank you @randyzwitch for the prompt response. That makes sense!

Will then probably go for a cloud-based solution.


1 Like

Hi everyone -

Secrets management is now available in Streamlit sharing! You need to upgrade to version 0.80 of Streamlit, the temporary documentation location is linked below.