python install mysql.connector code example
Example 1: python install mysql connector
pip3 install mysql-connector-python #Python 3
pip install mysql-connector-python
Example 2: how to install mysql connector python on mac
pip install mysql-connector-python
Example 3: mysql python connector
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="yourusername",
password="yourpassword"
)
print(mydb)