import mysql python 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 connect to mysql database in python
import mysql.connector
cnx = mysql.connector.connect(user='scott', password='password',
host='127.0.0.1',
database='employees')
cnx.close()