Hi,
Follow the steps to connect the MySQL database using Python:
1) first download the mysql-python 1.2.2 from sourceforge.net
2)modify the setup_posix.py line numbers:29,35
from mysql_config.path="mysql_config"
to
mysql_config.path = "/usr/local/mysql/bin/mysql_config"
3) save the file and now go to terminal
admin:~admin$ sudo python setup.py install
if u get gcc error then download the gcc from xcode tools
or else u have mac cds with u. In that keep 2nd cd in the disk and install the xcode tools from it.
4) please download the pyshell from sourceforge.net here is the link....
http://sourceforge.net/projects/pyshell/
5) copy the pyshell from downloaded to Library->Frameworks->Python.Framework->paste it.
6) Open the pyshell.py and close it.
7) now do the following step:
admin:~admin$ sudo python setup.py install
u will not get any gcc error.
8) open the idle from Python 2.5 or 2.6 not the python launcher.......
>>> import MySQLdb
>>>
u will get this it means MySQLdb was connected....
Keep enjoying.......