I have a MySQL container running on a Kube cluster and a flask app running on my local machine (which I eventually also plan to upload onto the kube cluster). How can I connect my flask app to the database? So far I have tried changing the host to the IP address of the Kube cluster.
conn = MySQLdb.connect(
host=host_ip,
user="root",
passwd="password",
db="flaskapp")
Just to reiterate, the flask application is running on my local machine. I can connect to a database that I run locally, but I'm not sure how to connect it to a database run on a Kube cluster, on a different machine.
you can use PyMySQL to connect to any DB, locally or online.