MySQLdb - parameterised SQL - how to see resulting SQL ?

Damjan gdamjan at
Thu May 18 06:09:01 CEST 2006

> ... i would be interested in seeing what the actual SQL used by the
> .execute looks like after the replacements have been done. Is there a
> way of doing this ?

On my development machine I'm using the "--log" argument to MySQL so that it
logs all queries and connections. I wouldn't recommend that on a production
machine though.

The logfile is stored in /var/lib/mysql/<hostname>.log


More information about the Python-list mailing list