Deploying on streamlit - Connection error with Database

Hi there, I have deployed an app on streamlit app. But it shows an error with connecting to database [I used mysql workbench]. It executed well on local machine. But gives an error while deploying. Please let me know if you have any solutions.

Error:
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 99] Cannot assign requested address)”)