Pat Collins - 2001-07-04

After much gnashig of teeth I finall got MySQLdb to install on RH7.1 with Python2.1.  I'm not very good at these things and sometimes install from RPM and sometimes from source.

This is based on having Python2.1 installed in /usr/lib/python2.1 so you can use both 1.52 and 2.1. Both were installed via RPM and installing MySQLdb from RPM using the relocation method would not work.  Mysql was installed from source and I had to moved the includes from the build directory to the /usr/include directory.

Just moving the files generated a C API error upon import.

Edit setup.py

change this in the sys.platform == "linux-i386": section
library_dirs = ['/usr/local/lib/mysql']
change this in the sys os.name == "posix": section
library_dirs = ['/usr/local/lib/mysql']

Now run python2 setup.py build and you should get a clean build. Su root and run python2 setup.py install.  Test in the usual python manner.  If you get a cannot load shared library for one of the mysql libraries then add /usr/local/lib/mysql to your ld.so.conf in /etc and run ldconfig.

My wife is yelling at me to watch fireworks, so if this is wrong you know why.