[Zope] Mini-HOWTO: Zope + MySQL under Windows

Derek Simkowiak dereks@realloc.net
Sun, 10 Mar 2002 23:04:15 -0800 (PST)


	Ever try to get a MySQL server and Zope running under MS-Windows?

	Here's what I had to do.  And no, I didn't find this documented
anywhere.  This was a bit challenging as I haven't really used MS-Windows
for anything other than gaming in about 5 years.


1. Install and start Zope
2. Install and start MySQL server (I'm using mysqld-opt.exe)
3. Install ZMySQLDA
	(*) You need a Windows program that can handle tarballs, as 
ZMySQLDA, like most Zope "Products", is not distributed as a .zip file

4. Restart Zope
5. Notice that the ZMySQLDA Product is showing as "broken" in the Zope
Control Panel, because you are missing the MySQL-python interface library
(distributed separately)

6. Try to install MySQL-python (filename "MySQL-python-0.9.1.win32-py2.1.exe")
	(*) This will fail, because the Windows installer program will
only unpack the files if it can find a "Python Installation" directory to 
unpack it into.  There is no way to specify your Zope Python install as it 
will only let you choose a Python install that is finds in the registry (I 
*think*).  I.e., you fscking NEED Python to get access to the files.  A 
.zip file was not available for download.

7. Download and install the win32 Python 2.1.2 (to match your Zope 2.5.0's 
Python)

8. Now install MySQL-python (it should work this time)

9. Restart Zope, and notice that the ZMySQLDA Product is broken, because 
it is not finding the MySQL-python interface library

10. At this point, you'll need to either (a) have payed attention to the 
directories the Windows Installers used, or (b) go surfing around your 
hard drive until you find where Zope, Python, and MySQL-python were 
placed.  For me it was (b).

11. Identify the files needed for MySQL-python.  Since MS-Window's package 
management system doesn't provide an "rpm -ql" equivalent, I guessed this 
to be

C:\Python21\
	_mysql.pyd
	_mysql_exceptions.py
	_mysql_exceptions.pyc
	_mysql_exceptions.pyo
	MySQLdb/   [dir with all contents]

	...then I copied those files into the directory

C:\Program Files\Demo\lib\python

	That "Demo" is the name of the directory Zope was installed into.

12. Restart Zope.


	Is is working?  Seems to be... I can talk to the database from
Zope.  It is correct and stable?  Fsck if I know.



--Derek