Tree [r673] / tags / MySQLdb-0.9.2b1 / MySQLdb /
History



File Date Author Commit
MySQLdb 2002-03-14 --none-- [r225] This commit was manufactured by cvs2svn to crea...
doc 2001-12-24 adustman [r202] Version 0.9.2a1. Unicode + DB-API extensions.
.cvsignore 2001-12-24 adustman [r202] Version 0.9.2a1. Unicode + DB-API extensions.
CHANGELOG 2002-01-25 adustman [r210] changes
CompatMysqldb.py 2002-03-14 --none-- [r225] This commit was manufactured by cvs2svn to crea...
MANIFEST.in 2001-09-12 adustman [r180] Added CHANGELOG. (John Bowe)
README 2001-10-31 adustman [r195] Some additional Zope notes.
_mysql.c 2002-03-14 adustman [r223] Bump version. Minor Alpha Linux update. Clear e...
_mysql_exceptions.py 2002-03-14 --none-- [r225] This commit was manufactured by cvs2svn to crea...
setup.cfg 2001-05-23 adustman [r142] 0.9.0c1 minor edit.
setup.py 2002-03-14 adustman [r223] Bump version. Minor Alpha Linux update. Clear e...

Read Me

Prerequisites:

Python 1.5.2 or higher
-- http://www.python.org/
-- Versions lower than 1.5.2 WON'T WORK.
-- All versions from 1.5.2 should work. 1.6.x versions have not been
   tested. 2.0.1, 2.1.1, and 2.2a3 have all been tested.
-- If you have Red Hat Linux or a similar packaging system, make sure
   you have the Python development headers and libraries (python-devel).
   For Python-2.x versions, this is python2-devel.

Distutils 1.0.2 or higher
-- comes starting with Python 1.6
-- 1.0.2 is included in Python version 2.1 and newer
-- http://www.python.org/sigs/distutils-sig/download.html

MySQL 3.22.19 or higher
-- http://www.mysql.com/downloads/
-- Versions lower than 3.22 definitely WON'T WORK.
-- Versions lower than 3.22.19 might not work.
-- The current 3.22 release is 3.22.32.
-- MySQL-4.0 is supported. Current release 4.0.0 alpha.
-- MySQL-3.23 is supported. Current release: 3.23.43.
-- MySQL-3.22 is slightly deprecated in favor of 3.23.
-- If you have Red Hat Linux or a similar packaging system, make sure
   you have the MySQL development headers and libraries. If you use the
   mysql.com packages, this is MySQL-devel. If you use the Red Hat packages,
   this is mysql-devel. I prefer the mysql.com packages.

First thing to do is edit setup.py. There are some variables towards the
beginning that tell it where your MySQL include files and libraries are.
The values are right for MySQL's standard Red Hat Linux (6.2) RPMs. If
you have another platform, you'll have to figure out the right values
yourself. You should almost never have to change this. If you have an old
version of distutils (pre-1.0.2), upgrade, or remove the parameters that
are complained about. 

Note that recent binary distributions from mysql.com include two sets
of client libraries: mysqlclient and mysqlclient_r. The latter are the
"thread-safe" libraries, so use those if you can, and if threading is
important to you.

If you have the dynamic client libraries (on Linux, .so vs. .a), those
will be used by default. If they are not on your standard loader path,
you will have to set or adjust the LD_LIBRARY_PATH environment variable
(on Linux) or whatever your platform requires. Otherwise, you can adjust
setup.py to link against the static library. If you are using standard
RPM packaging, you shouldn't have to mess with this. If you compiled MySQL
yourself, you might.

Finally, putting it together:

$ python setup.py build
# python setup.py install

Zope: If you are using a binary package of Zope, you need run setup.py
with Zope's python executable. Otherwise, Zope (ZMySQLDA) will not
be able to find _mysql. However, I have had reports that the Zope
binary packages do not have the files necessary to compile Python
extension modules. Your best option in this case is to install Python
2.1.1 separately, compile MySQLdb with that, and then relocate them into
your Zope tree. Running setup.py install with the --prefix=xxx option
may accomplish this; see setup.py install --help. You *might* also be
able to build with the system-wide Python and install using Zope's Python,
but I haven't tried this, and I don't even know if binary Zope packages
have distutils (they probably do).

If you prefer RPMs, you can use the bdist_rpm command with setup.py.
This only builds the RPM; it does not install it.

Thanks go to Brian Fordham for cooking up an early version of setup.py.

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

Andy Dustman <andy@dustman.net>
2001-10-30