mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
58 lines
2.2 KiB
Plaintext
58 lines
2.2 KiB
Plaintext
Prerequisites:
|
|
|
|
Python 1.5.2 or higher
|
|
-- http://www.pythonlabs.com/products/python2.0/download_python2.0.html
|
|
-- http://www.python.org/1.6/
|
|
-- http://www.python.org/1.5/
|
|
-- Versions lower than 1.5.2 WON'T WORK.
|
|
-- If you have Red Hat Linux or a similar packaging system, make sure
|
|
you have the Python development headers and libraries (python-devel).
|
|
|
|
Distutils 1.0 or higher
|
|
-- comes with Python 1.6 and 2.0
|
|
-- 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 (recommended) 3.22 release is 3.22.32.
|
|
-- MySQL-3.23 is beta at present but supported.
|
|
-- If you have Red Hat Linux or a similar packaging system, make sure
|
|
you have the MySQL development headers and libraries (MySQL-devel).
|
|
|
|
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.
|
|
|
|
Note that recent binary distributions 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.
|
|
|
|
Finally, putting it together:
|
|
|
|
$ python setup.py build
|
|
# python setup.py install
|
|
|
|
TIP: 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.
|
|
|
|
If you prefer RPMs, you can use the bdist_rpm command with setup.py.
|
|
|
|
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>
|
|
2000-11-30
|