??????Linux?????Python????MySQL????????????MySQLdb module?????潫??????Linux???????MySQLdb??????
??????1??????MySQLdb
??????SourceForge.net???????μ?MySQLdb??http://sourceforge.net/projects/mysql-python/ ??
??????????????
????tar -zxvf MySQL-python-1.2.3
??????MySQL-python-1.2.3??????У???????????README?????У????????????????????
????$ tar xfz MySQL-python-1.2.1.tar.gz
????$ cd MySQL-python-1.2.1
????$ # edit site.cfg if necessary
????$ python setup.py build
????$ sudo python setup.py install # or su first
?????????????????????????????MySQLdb???Щ????????????Python 2.3.4 or higher??setuptools??MySQL 3.23.32 or higher??zlib??openssl?? C compiler???????????????????????????????????????????????á?
??????2?????setuptools
??????http://pypi.python.org/pypi/setuptools ????????python?汾??????egg???????????????python 2.4???????????????setuptools-0.6c11-py2.4.egg
??????egg?????????е????
????chmod +x setuptools-0.6c11-py2.4.egg
???????shell????????egg
????sh ./ setuptools-0.6c11-py2.4.egg
?????????????
??????3?????MySQL
??????http://www.mysql.com/downloads/mysql/ ???????????OS??????mysql?汾???????????????????????devel?汾??MySQL??
??????????????? MySQL-devel-5.5.8-1.rhel5.i386.rpm
???????rpm??
????rpm -ivh MySQL-devel-5.5.8-1.rhel5.i386.rpm
???????????/usr/bin?£????????/usr/bin?·??????????


[root@********]# ls /usr/bin/ | grep "mysql"
msql2mysql
mysql
mysqlaccess
mysqlaccess.conf
mysqladmin
mysqlbinlog
mysqlcheck
mysql_config
mysqldump
mysql_find_rows
mysqlimport
mysqlshow
mysqlslap
mysql_waitpid

???????У?mysql_configλ???????MySQLdb???μ?site.cfg?????????????
????cd MySQL-python-1.2.3
????vim site.cfg
????????????????
????# The path to mysql_config.
????# Only use this if mysql_config is not on your PATH?? or you have some weird
????# setup that requires it.
????mysql_config = /usr/bin/mysql_config
???????棬?????
???????????????python setup.py build?????п??????????′???
????unable to execute gcc: No such file or directory
????error: command 'gcc' failed with exit status 1
?????????????л???а????????????????????????GCC??
??????4?????GCC