Mini-HOWTO: Zope + MySQL under Windows
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
On Mon, 2002-03-11 at 02:04, Derek Simkowiak wrote:
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 [don't] start Zope [from source] 2. Install and start MySQL server (I'm using mysqld-opt.exe) 3. Install ZMySQLDA
Might I suggest a little streamlining: [comments in brackets] [if you have C compiler and Python 2.1.2 installed:] 4. Run setup.py install 5. Start Zope. [if you don't have a C compiler:]
1. Install and [don't] start Zope [binary package] 2. Install and start MySQL server (I'm using mysqld-opt.exe) 3. Install ZMySQLDA [4]. Download and install the win32 Python 2.1.2 (to match your Zope 2.5.0's Python) [5]. Try to install MySQL-python (filename "MySQL-python-0.9.1.win32-py2.1.exe") [6]. Copy the MySQL-python files from your Python 2.1.2 installation into your Zope installation's lib\python. [7]. Start Zope.
I can not build MySQL-python for Windows, let alone make an installer; I have neither the tools nor the inclination to do so. If someone thinks they can make a better installer then please contact me. -- Andy Dustman PGP: 0x930B8AB6 @ .net http://dustman.net/andy You can have my keys when you pry them from my dead, cold neurons.
-> [if you don't have a C compiler:] This was my predicament. I haven't installed Cygwin on this laptop. -> [5]. Try to install MySQL-python (filename "MySQL-python-0.9.1.win32-py2.1.exe") -> [6]. Copy the MySQL-python files from your Python 2.1.2 installation -> into your Zope installation's lib\python. -> [7]. Start Zope. This is what I did. I just wrote the steps up as I discovered them, including my reasonings :) -> I can not build MySQL-python for Windows, let alone make an installer; I -> have neither the tools nor the inclination to do so. If someone thinks -> they can make a better installer then please contact me. I would like to see MySQL-python packaged and included with the MySQLDA. This has some key advantages: 1. Easier installation (esp. for the Windows version!) 2. More stable, maintainable, and easier to troubleshoot, as you always know EXACTLY what version of MySQL-python the user is running MySQLDA against. 3. Less documentation/external links/yet-another-website for the User to visit The drawback is a potentially small bit of wasted hard-drive space on the enduser's machine (if they need to have MySQL-python both under the Zope install, as well as in their full Python install.) Alternatively, I would like the MySQL-python Windows installer to let me specify a directory, whether or not it "recognizes" that directory as a full-fledged Python install dir. --Derek
[Derek Simkowiak]
-> [if you don't have a C compiler:]
This was my predicament. I haven't installed Cygwin on this laptop.
-> [5]. Try to install MySQL-python (filename "MySQL-python-0.9.1.win32-py2.1.exe") -> [6]. Copy the MySQL-python files from your Python 2.1.2 installation -> into your Zope installation's lib\python. -> [7]. Start Zope.
At this point you ought to be able to remove the extra Python installation from your computer, if you really don't want it. It seems to me that there should be one registry setting which you could change or add, that would let the MySQL-python installer know to use Python installation in Zope . I'll bet it's the key named HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.1\InstallPath If you create this key and give it the string value of the path to the directory your Zope python.exe is in, I bet everything will install fine. Then you wouldn't need to fuss around with an extra Python installation at all. Cheers, Tom P
participants (3)
-
Andy Dustman -
Derek Simkowiak -
Thomas B. Passin