
Remember, you don't need to be authentificated in order to use the English language.
An online scrapbook about the stuff I happen to be tinkering with.
_mysql_exceptions.OperationalError: (1267, "Illegal mix of collations (latin2_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation 'UNION'")
import MySQLdb
import MySQLdb.cursors # Import this so that DictCursors can be used.
# host, user, passwd and db to be defined by user ofcourse.
db = MySQLdb.connect(host = host, user = user, passwd = passwd, db = db, cursorclass=MySQLdb.cursors.DictCursor)
show = db.cursor()
q = "SHOW VARIABLES LIKE 'character_set_database'"
show.execute(q)
value = show.fetchone()['Value']
q = """SET NAMES '%s' """ % value
show.execute(q)