I have made a free account on https://www.freemysqlhosting.net which provides a free mysql database hosting facilities. I have created a database there, but I don't know how to connect to it from my python code on VSCode.
As of now, I am using a database that is on my computer.
This is the code in a config.py
file that establishes connection to the MySQL server.
import mysql.connector as mysql
mysqlobj = mysql.connect(host='localhost', user='root',password='Mypass', database='timetable')
cursorobj = mysqlobj.cursor()
cursorobj.execute('USE timetable')
So how do I connect to a remote database on the said website with a piece of code that can be executed, because that way the connection can be established from any computer if they have the code to do so, without installing extensions(unless it's necessary).
If you require more details, please do ask in the comment section.