Index of /

 NameLast modifiedSizeDescription

 BIMPLiteConfig.bat 2007-08-14 10:59 3.5K 
 Merchant/ 2007-06-20 13:52 -  
 WebCalendar-1.2.5.ta..>2012-02-29 13:25 1.3M 
 WebCalendar-1.2.5.ta..>2012-02-29 13:25 1.3M 
 WebCalendar-1.2.5/ 2007-08-05 22:28 -  
 __MACOSX/ 2011-03-10 20:33 -  
 _mgxftp/ 2007-08-14 10:59 -  
 _mgxroot/ 2007-08-14 11:00 - 2019-05-20 11:26 - 2011-10-04 16:24 389K 
 cgi-bin/ 2004-07-30 21:18 -  
 cm/ 2005-11-28 09:42 -  
 img/ 2005-05-14 16:09 -  
 linttylog-1.00-0.i38..>2005-12-20 14:28 13K 
 listings/ 2006-03-07 15:17 -  
 mivatest/ 2005-08-04 18:29 -  
 newcalendar/ 2011-10-04 14:59 -  
 phpads/ 2005-01-13 10:43 -  
 phpinfo.php 2008-09-13 18:54 19  
 phpwiki/ 2005-08-31 14:42 -  
 rss.php 2005-07-31 14:33 11K 
 smartphpcalendar/ 2013-02-26 02:54 -  
 test.wmv 2005-08-18 14:25 0  
 test/ 2004-01-10 15:16 -  
 wdCalendar/ 2016-10-20 23:42 - 2015-06-23 14:46 -  

MySQLdb Installation

MySQLdb Installation


Building and installing

The script uses mysql_config to find all compiler and linker options, and should work as is on any POSIX-like platform, so long as mysql_config is in your path.

Depending on which version of MySQL you have, you may have the option of using three different client libraries:

mostly but not guaranteed thread-safe
thread-safe, use if you can
embedded server

mysqlclient_r is used by default. To use one of the others, set the environment variable mysqlclient to the name of the library you want to use. In a Bourne-style shell, use:

$ export mysqlclient=mysqlclient

Only do this if you don't have the thread-safe library (mysqlclient_r) or you want to use the embedded server (mysqld).

Finally, putting it together:

$ tar xfz MySQL-python-1.1.10.tar.gz
$ cd MySQL-python-1.1.10
$ python build
$ su # or use sudo
# python install

NOTE: You must export environment variables for to see them. Depending on what shell you prefer, you may need to use "export" or "set -x" (bash and other Bourne-like shells) or "setenv" (csh-like shells).


I don't do Windows. However if someone provides me with a package for Windows, I'll make it available. Don't ask me for help with Windows because I can't help you.

Generally, though, running is similar to above:

C:\...> python install
C:\...> python bdist_wininst

The latter example should build a Windows installer package, if you have the correct tools. In any event, you must have a C compiler. Additionally, you have to set an environment variable (mysqlroot) which is the path to your MySQL installation. In theory, it would be possible to get this information out of the registry, but like I said, I don't do Windows, but I'll accept a patch that does this.


If you are using a binary package of Zope, you need run with the python executable that came with Zope. Otherwise, you'll install into the wrong Python tree and Zope (ZMySQLDA) will not be able to find _mysql.

With's Zope-2.5.1-linux2-x86 binary tarball, you'd do something like this:

$ export ZOPEBIN=".../Zope-2.5.1-linux2-x86/bin" # wherever you unpacked it
$ $ZOPEBIN/python install # builds and installs

Binary Packages

I don't plan to make binary packages any more. However, if someone contributes one, I will make it available. Several OS vendors have their own packages available.


If you prefer to install RPMs, you can use the bdist_rpm command with This only builds the RPM; it does not install it. You may want to use the --python=XXX option, where XXX is the name of the Python executable, i.e. python, python2, python2.1; the default is python. Using this will incorporate the Python executable name into the package name for the RPM so you have install the package multiple times if you need to support more than one version of Python.

Red Hat Linux

MySQL-python is pre-packaged in Red Hat Linux 7.x and newer. This likely includes Fedora Core and Red Hat Enterprise Linux. You can also build your own RPM packages as described above.

Debian GNU/Linux

Packaged as python-mysql:

# apt-get install python-mysql

Gentoo Linux

Packaged as mysql-python. Gentoo is also my development platform:

# emerge sync
# emerge mysql-python
# emerge zmysqlda # if you use Zope


MySQL-python is a ported package in FreeBSD, NetBSD, and OpenBSD, although the name may vary to match OS conventions.


GPL or the original license based on Python 1.5.2's license.

Author:Andy Dustman <>
Revision:$Id: README,v 1.10 2005/02/01 04:01:40 adustman Exp $