Many of the given answers here are quite confusing so I will try to put it simply. It helped me to install this
pip install pymysql
and then use the following command in the python file
import pymysql as MySQLdb
This way you can use MySQLdb without any problems.