import MySQLdb
# connect to the database
db = MySQLdb.connect("****","****","****","****") #don't use charset here
# setup a cursor object using cursor() method
cursor = db.cursor()
cursor.execute("SET NAMES utf8mb4;") #or utf8 or any other charset you want to handle
cursor.execute("SET CHARACTER SET utf8mb4;") #same as above
cursor.execute("SET character_set_connection=utf8mb4;") #same as above
# run a sql question
cursor.execute("****")
...
#and make sure the mysql settings are correct, data too