if you want to use MySQLdb first you have to install pymysql on your pc by typing in cmd of windows
pip install pymysql
then in python shell, type
import pymysql
pymysql.install_as_MySQLdb()
import MySQLdb
db = MySQLdb.connect("localhost" , "root" , "password")
this will establish the connection.