Scripting Python to connect to a MySQL database is fairly simple, even if you don’t have any much experience with Python.
You will need to have Python and MySQL installed. Once you have Python installed, you will need to import the MySQLdb and sys modules. For MySQL, you will simply need a user that has permissions to connect to the database and perform a select statement.
For this example, I am using Python v2.5, MySQL version 5.5.8., with Mac OS X 10.6.8.
Here are the links to download the files and applications
necessary for this example script:
MySQL – http://dev.mysql.com/downloads
Python – www.python.org/getit/
MySQLdb module – …