[Zope] [Help] Setting up MySQLconnection

Matthew T. Kromer matt@zope.com
Mon, 25 Mar 2002 13:55:25 -0500


Richard Wesley wrote:

> I am trying to set up a mySQL DB adapter in Zope.  I am somewhat of a 
> Zope and Linux newbie so I am probably doing something dumb.  Here is 
> what I have done:
>
> - Downloaded MySQL-python-0.9.0 to the Zope install dir;
> - tar -xzvf MySQL-python-0.9.0.tar.gz
> - cd MySQL-python-0.9.0
>
> At this point I looked at the README.  It requires Python 1.5.2 or 
> higher (I think we have 2.2) and a recent MySQL (which I believe we 
> have).  I did not edit setup.py because we are running Red Hat.  I 
> then do


Since Zope is not supported under Python 2.2, I *strongly* recommend 
building everything with Python 2.1.2 instead.

>
> - python setup.py build
>
> and it chugs along until it gets to the gcc _mysql.c when it gives me 
> an error
>
> _mysql.c: In function `_mysql__fetch_row':
> _mysql.c: too many arguments to function `PyTuple_Resize'
>
> This looks to me like a call to the Python API and it appears that my 
> libraries define this differently from what the code expects.


I don't actually know if PyTuple_Resize changes in Python 2.2 vs 2.1, 
but it may have.  I would also recommend that you grab the latest 
sources for the Python MySQL driver from SourceForge.net; I believe the 
ZMySQLDA package includes everything you need.

-- 
Matt Kromer
Zope Corporation  http://www.zope.com/