In this one we are going to learn how we can configure python to connect with mysql server.
pip install mysql-connector-python
To test the connection create a python file and add the following code in it:
from mysql import connector config ={ 'host': '127.0.0.1' or 'localhost', 'user': 'root', 'password': 'root', 'database': 'todos', 'port': 3306 } conn = connector.connect(**config) # closing the connection conn.close()