I had a hard time installing a python connector to a MySQL database. I tried to install MySQLdb but had problems during compilation. Fortunately, MySQL release a connector written in Python. I wanted to install it in a virtual environnement.
To do so :
venv environnement
cd environnement
source bin/activate
pip install mysql-connector-repackaged
To check the installation is working
import mysql