Python MySQLdb exceptions

exception, mysql, python

Solution

Catch the MySQLdb.Error, while connecting and while executing query

Problem

Just starting to get to grips with python and MySQLdb and was wondering Where is the best play to put a try/catch block for the connection to MySQL. At the MySQLdb.connect point? Also should there be one when ever i query? What exceptions should i be catching on any of these blocks? thanks for any help Cheers Mark

Original source