Create a folder and go inside of the folder
mkdir python_database
cd python_database
Installation
pip install mysql-connector-python
Now Create file db.py
## Connecting to the database
import mysql.connector as mysql
db = mysql.connect(
host="localhost",
user="root",
passwd="root@123"
)
print(db)