Tag: mysql

Python and MySQLdb quick note

Quick note for basic stuff in python: #import stuff import MySQLdb # connect try: db = MySQLdb.connect(host=”localhost”, user=”user”, passwd=”password”, db=”mydb”) except Exception, e: sys.exit(“Problem connecting to DB: %s” % e) # Cursor cur = db.cursor() # Defer warnings if needed,…