I read a message out of my Database like this:
import MySQLdb
db = MySQLdb.connect(host="localhost", user="?", passwd="?", db="?")
cur = db.cursor()
message = cur.execute("SELECT Nr, Nachricht from message")
for row in cur.fetchall() :
print row
cur.close()
db.close()
The Output is right but, the numbers get an L at the and like:
DB->'2'; Output->'2L'
. But also the 'ä', 'ü', 'ö' and 'ß' get a wrong Output like:
DB->'ü'; Output->'\xfc'