[Zope] MySQLDA woes with 2.4.1 RH6.1

Andy Dustman andy@dustman.net
21 Sep 2001 09:37:53 -0400


On Fri, 2001-09-21 at 07:18, Richard Moon wrote:
> Thanks for replying - do I detect a slight hint of sarcasm ?

And you're a consultant, right?

> Before attempting the installation I looked for How_toe, read the 
> documention provided and checked the Zope list archive.
> 
> The documentation is not adequate. Here we go for MySQLDA
> "Installation: Unpack the tarball in your Zope home, make sure you have 
> MySQLdb-0.9.0 installed where Zope can find it, and restart Zope. "
> 
> where Zope can find it ???

i.e., somewhere on Zope's PYTHONPATH. This would be in Zope's
lib/python, or within the Python libraries of the Python you are using
to run Zope.
 
> OK so you follow the link to MySQLdb-0.9.0 - goes to sourceforge - so wher 
> then - ah a docs link - what's this Using and Extend, Using the API - 
> where's the 'installation bit ?' check out the General Introduction - find 
> it 'should build' by using the setup.py script

Unless your system is exceedingly weird or lacking essential components
(listed at the top of README), it should build, always. It builds on Red
Hat, FreeBSD, OS X, Windows, and probably a couple of others with no
modifications.
 
> So at this point I check out the How-Tos - one - but its old - says you 
> have to have the source distribution for Zope AND python. Now I already 
> have an earlier ZMySQLDA running and I know I didn't install from the 
> Source but it was last year and I've done sooo many other things since then 
> I can't remember what I did do ...

Take notes next time.

> OK check out the archive - still trying to find where to unpack the MySQLdb 
> tarball so that 'Zope can find it' No clues there, except Andy saying it 
> doesn't have to be in the /lib/Products directory - so it CAN go there but 
> perhaps it shouldn't ?
> 
> Check out the FAQ - there's something there about compiling - so I'm trying 
> to create a module _mysqlmodule.so - what's that for, where does it go when 
> I have compiled it ?

If you'd just run setup.py install, this would all be done for you...

> By now I've taken the plunge and unpacked the tarball - look at the README, 
> says I need distutils if I'm running Python 1.5 but Zope 2.4 uses Python 
> 2.1 so guess I'm OK there (miss out an important bit of news that I need 
> the development version of Python 2.1) talks about running setup.py - look 
> at the setup.py script - which says shouldn't need altering for RH so run 
> it. TOtally unsurpised to get an error - can't find python.h - give up at 
> this point and throw myself at mercy of the list and get kicked in the head 
> (while being given a useful clue).

If it can't find python.h, you *don't* have the development package for
Python 2.1.

> Oh the joy of Zope.
> 
> Still don't know why it has to be so complicated - why it can't ship with 
> the Zope RPM - perhaps its a kind of test.

MySQLdb and ZMySQLDA are two separate packages, because non-Zope python
programs only need MySQLdb. Nevertheless, the README in MySQLdb that you
don't want to read contains the following tip:

"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."

Another tip: Use MySQLdb-0.9.1c2. Read the notes on SourceForge to see
why.

-- 
Andy Dustman         PGP: 0x930B8AB6
    @       .net     http://dustman.net/andy
You can have my keys when you pry them from my dead, cold neurons.