I am pickling Python Objects in Django and saving it in MySQL db. So far i have followed these simple rules:
cPickle.dumps(object) #to convert
cPickle.dumps(object)
one more rule: connect to mysql with option charset=utf8?
charset=utf8
UPD1: Sometimes it is a good idea to look at the complete SQL query, I usually do it that way:
>>> conn = MySQLdb.connect(**db_params) >>> "INSERT INTO tbl VALUES (%s)" % conn.literal((your_pickled_item, ))