The global idea is to extract some information from a Database (Locally hosted by MySQL) then filter the information using SQLAlchemy to finally create the get statements in the FastAPI app. This works wonderful locally, however when I try to deploy the app in Heroku I get the following error:
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
Now I'm wondering if I can create the connection to local hosted database and Heroku, if so, how?
Any help would be so appreciated!