Next
Previous
Contents
There are a few tricks to getting Zope's ZMySQLDA to work with
_mysql
. But it ain't that hard, really.
Also see the
ZMySQLDA HOWTO.
The basic steps are:
- Install MySQLdb first, so that it's on your
PYTHONPATH
and Zope can find it.
- Untar the ZMySQLDA tarball (available from
zope.org).
- Patch it with the ZMySQLDA.patch included with the MySQLdb
distribution. In the directory that you did the untar,
patch -p1 </path/to/ZMySQLDA.patch
- If you do a make, which is what the ZMySQLDA instructions
tell you, it will try to compile the older
MySQLmodule, which you don't need. Ignore stuff like:
./MySQLmodule.c: In function `pythonify_row':
./MySQLmodule.c:238: warning: assignment from incompatible pointer type
./MySQLmodule.c: In function `pythonify_res_fields':
./MySQLmodule.c:384: invalid lvalue in unary `&'
./MySQLmodule.c: In function `STH_fetchdict':
./MySQLmodule.c:1125: invalid lvalue in unary `&'
./MySQLmodule.c:1147: invalid lvalue in unary `&'
make: *** [MySQLmodule.o] Error 1
MySQLmodule.c doesn't compile against
MySQL-3.22 without patches. Which is why MySQLdb exists...
- Restart Zope. You should have a ZMySQLDA Product in the
Control Panel.
I'm not the best person to ask. There are two main steps to getting
started.
- Create a ZMySQLDA Connection object somewhere.
- The connect string syntax is "database@host user password".
If the database is on the same host as the Zope server, you can leave
out @host. You might be able to leave off user and password as well,
depending on your GRANT tables. Whether or not this is a good idea is
another question.
- You're on your own. I recommend reading the
Z SQL Method's User Guide and maybe
searching the Zope website for SQL.
Next
Previous
Contents