List:General Discussion« Previous MessageNext Message »
From:Eric Maryniak Date:August 2 2000 10:14am
Subject:Zope MySQL DA (Database Adapter) installation howto
(step-by-step) under SuSE Linux 6.3/6.4
View as plain text  
Hello list,

If you are running Zope ( on SuSE Linux 6.3/6.4 and want
to use Zope's MySQL DA (database adapter), here's a small step-by-step
howto, because I had to grab together some docu on the Zope site and
there were some installation thingies that weren't too obvious.

Necessary precondition is of course that you are running Zope --- a
detailed step-by-step procedure on how to install Zope on _SuSE_
Linux can be found at:

(other distro's, like RedHat, have ready-to-go rpm's).

Then, in order to use SQL from Zope to MySQL, install the MySQL
database adapter, as described below.

Good luck! Bye-bye, Eric
o MySQL database access via Zope.
  Installing the Zope MySQL Database Adapter (ZMySQLDA), version 1.2.0
  or newer (which includes MySQLdb 0.1.2 or newer).
  ZMySQLDA url:

  Verify that Python >= 1.5.2 is installed, MySQL and the MySQL libraries
  (which must be locatable by ld) version 3.22.11 or higher:

      # rpm -qa | egrep -i '(python|mysqldev)'


      # ldconfig -p | grep -i mysql (libc6) => /usr/lib/ (libc6) => /usr/lib/

  Download 'ZMySQLDA-1.2.0.tar.gz' to /usr/src/packages/SOURCES/ and
  unpack it in the Zope top-level directory:

      # cd /opt/zope
      # tar zxvf /usr/src/packages/SOURCES/ZMySQLDA-1.2.0.tar.gz

  Fix ownership and permissions:

      # chown -R root:root /opt/zope/lib/python/Products/ZMySQLDA/.
      # chmod -R og-w      /opt/zope/lib/python/Products/ZMySQLDA/.
  Verify that there are no setuid or setgid files (always a safe

      # find /opt/zope \
             -type f \( -perm -04000 -o -perm -02000 \) -exec ls -lg {} \;

  Go to the MySQLdb-0.1.2 sub-directory:

      # cd /opt/zope/lib/python/Products/ZMySQLDA/MySQLdb-0.1.2

  Make a copy and then edit the file '':

      # cp -pv

  change the one (1) line with -L and -I flags to:

      _mysql _mysqlmodule.c -L/usr/lib -I/usr/include/mysql -lmysqlclient

  Next build the ZMySQLDA product, while still in the MySQLdb sub-directory

      # python

  And install:

      # make install
      # cp -pv{,c,o} /usr/lib/python1.5/site-packages

  Finally, restart Zope:

      # rczope restart

  Now you can make a ZMySQL connection.
  Inside a Folder, add a 'ZMySQL Database Connection' Item.
  The "connection string" looks like:

      database[@host] user passwd

  For the Client database user client_db_readonly@localhost, this becomes
  (replace XXXXXXXX with the real password of client_db_readonly):

      client@localhost client_db_readonly XXXXXXXX

  Go to the 'Test' tab, enter this query and then 'Submit Query':

      SELECT, client.order FROM client;

  You should get a table.
Eric Maryniak <e.maryniak@stripped>
Home page:
University of Amsterdam, Department of Psychology.
Tel/Fax: +31 20 5256853/6391656. Internet:

From "15 reasons why Star Trek is better than the X-Files":

  12. No one in Star Trek can be accused of not getting out enough.

Zope MySQL DA (Database Adapter) installation howto(step-by-step) under SuSE Linux 6.3/6.4Eric Maryniak2 Aug