Ok, I enter the MySQL command line client with root privileges. Then I open or otherwise launch the python application using the MySQLdb module as root. When I check the results with python (IDLE), everything looks great. When I use the MySQL command line client, no INSERT has occurred. If I change things to _mysql instead of MySQLdb, everything works fine. I would appreciate any clarification.
"Works" until the IDLE / Virtual Machine is reset:
import MySQLdb db = MySQLdb.connect(user='root', passwd='*******',db='test') cursor = db.cursor() cursor.execute("""INSERT INTO test VALUES ('somevalue');""",)
Works:
import _mysql db = _mysql.connect(user='root', passwd='*******',db='test') db.query("INSERT INTO test VALUES ('somevalue');")
System Information: Intel x86 WinXP Python 2.5 MySQL 5.1.41 MySQL-Python 1.2.2
source share