[Zope] RE: Zope and MySQL on Windows

Deb B. intranetdeb@yahoo.com
Tue, 24 Dec 2002 11:24:51 -0800 (PST)


--0-1447942785-1040757891=:95725
Content-Type: text/plain; charset=us-ascii


I came to this group today to see what I could find on a particular 
ZOPE/MySQL issue I'm having. It relates to this thread, somewhat. I 
hope someone can give me some insight.

I have ZOPE installed on a WIN98 machine that is acting as a 
temporary server until we go through a complete network upgrade to 
Windows 2000 Server, et. al. I have a development workstation that is 
using Windows 2000 Professional. This machine is where I have 
installed MySQL. So, I have ZOPE on one machine and MySQL on the 
other. 

I installed the myODBC from mysql.com because I couldn't get any of 
the ZMySQLDA/MySQLdb products to work on any version of Windows 
(obviously it favors the Unix/Linux environment). Well, Windows is 
what I'm stuck with now.

I created databases, set up my ODBC connections, set up my Z SQL 
Methods and SQL Forms (depending upon which databases I access) and 
can access the databases with beautiful results on my ZOPE 
pages......BUT.....the results are extremellllllllllllllllllllly slow 
in coming. Even small databases with just a few records take forever 
to come up even with the most basic of SQL statements using either 
SQL Forms (for example, my Purchase Order database):


<dtml-var standard_html_header>
<dtml-if CheckPermissions>

<dtml-unless REFERER><dtml-call "REQUEST.set
('REFERER',HTTP_REFERER)"></dtml-unless>
<dtml-unless sqf_edit_method><dtml-call "REQUEST.set
('sqf_edit_method','edit')"></dtml-unless>

<h3>> <dtml-var title_or_id>: <dtml-var document_title> (List)</h3>
<P>
<a href="&dtml-URL2;/">Up</a> -
<a href="&dtml-REFERER;">Back</a> -
<a href="list?REFERER=&dtml-REFERER;">List</a> -
<a href="add?REFERER=&dtml-REFERER;">Add</a>

<br><br>

        
<table CELLSPACING='&dtml-table_cell_spacing;'>
<tr BGCOLOR='&dtml-internal_title_color;'>
 <th>P.O.#</th>
 <th>Order Date</th>
 <th>P.O. Vendor</th>
 <th>Items</th>
 <th>Terms</th>
 <th>Total</th>
</tr>


<dtml-call "REQUEST.set('bat_size',_.int(viewlistlen))">
<dtml-unless start_key><dtml-call "REQUEST.set('start_key',0)"></dtml-
unless>
<dtml-if "_.int(start_key)<0"><dtml-call "REQUEST.set
('start_key',0)"></dtml-if>
<dtml-call "REQUEST.set('next_key',_.int(start_key))">

<dtml-call "REQUEST.set('flag',0)">

<dtml-call "REQUEST.set('q','select * from po2002 where autoid 
>= '+_.str(start_key)+' order by autoid asc')">


<dtml-try>
<dtml-in "SQL(q=q)" size=bat_size>
<dtml-if "_.int(next_key) < _.int(autoid)">
  <dtml-call "REQUEST.set('next_key',autoid)">
</dtml-if>

<tr valign="top" align="left" BGCOLOR='<dtml-if "_.int(flag)
==1">&dtml-internal_c1_color;<dtml-else>&dtml-
internal_c2_color;</dtml-if>'>

 <td><a href="&dtml-sqf_edit_method;?edit_key=<dtml-var 
autoid>&REFERER=&dtml-REFERER;"><dtml-var autoid></a></td>
 <td><dtml-var order_date></td>
 <td><dtml-var vendor_name></td>
 <td><dtml-var items></td>
 <td><dtml-var terms></td>
 <td><dtml-var total></td>
</tr>
<dtml-call "REQUEST.set('flag',1-_.int(flag))">
</dtml-in>

<dtml-except>
  <h1>General error</h1>
  <dtml-var errorinternalmethod>
</dtml-try>

</table>
<!-- navigation links -->
<br>
<a href="&dtml-URL0;?start_key=0&REFERER=&dtml-REFERER;">First</a> -
<a href="&dtml-URL0;?start_key=<dtml-var "_.int(start_key)-_.int
(bat_size)">&REFERER=&dtml-REFERER;">Prev</a> -
<a href="&dtml-URL0;?start_key=<dtml-var "_.int
(next_key)">&REFERER=&dtml-REFERER;">Next</a>

<dtml-else>
    <dtml-var standard_html_header>
</dtml-if>
<dtml-var standard_html_footer>


and then Z SQL Methods (for example, a document log database):

Example 1:

select * from yr2000 

Example 2:

SELECT * FROM yr2000 WHERE doc_author='JEF'

I also tried to set up a search form so users can perform searches 
themselves instead of having to be limited to choosing from pre-
constructed reports I provide them. It's 
daaaaaaaaaaaaaaawwwwwwwwwwwwwwwggggggggggggggg slowwwwwwwwwwwwwwwww 
though. I even went so far as to perform table structure tests on my 
MySQL databases to ensure I was optimizing them for the fastest 
performance. Any searches done through a MySQL client returns quick 
results but I want all of their access to these databases to be web-
based (i.e., through ZOPE site). Help!

Thanks.
Deb


--- In zope@yahoogroups.com, "Bryan Capitano" 
wrote:
> There are several options to using Zope+MySQL on the same Windows 
box. I
> have not done this in a production server environment, so I can't 
say how
> well that would work. But for development purposes, it works just 
fine.
> 
> I had some problems getting python-MySQL adapter to install on 
Windows and
> recognize my python installation (because I was trying to install 
MySQLDA).
> But there are two ways around this problem which I've learned:
> (1) One is to install MyODBC (see www.mysql.com) and create a 
System ODBC
> database for your MySQL database. Then install the MyODBCDA 
database adapter
> for Zope (instead of MySQLDA). This allows you to talk to MySQL 
through an
> ODBC bridge. This solution works like a charm.
> (2) The second workaround is to install Python2.1.3 on your machine
> separately from the Windows Zope installation. Then install the .exe
> Mysql-Python package (www.sourceforge.net). Then copy the installed 
files to
> the Zope/Python directory. Then install MySQLDa. This solution was 
provided
> to me by another list member (hiren_hindocha@a...).
> 
> 

> -----Original Message-----
> From: zope-admin@z... [mailto:zope-admin@z...]On Behalf Of Greg &
> Janet LINDSTROM
> Sent: Saturday, November 02, 2002 7:41 AM
> To: zope@z...
> Subject: [Zope] Zope and MySQL on Windows
> 
> 
> Greetings-
> I have a fairly mature Python application which uses MySQL for the 
database.
> I would like to switch over from a single machine application to a 
web based
> app (and maybe even make some money!!), and thought Zope would be 
the
> logical choice. The past 2 weeks have had me running through the 
examples
> in the Zope book and the Zope "Bible", and I *think* I am ready to 
create a
> project. Then I read the the creators of Zope do not reccommend 
using MySQL
> with Zope on a Windows box. Rats! So...
> 1. Is this still sound advice?
> 2. If so, what other Open Source Database is out there. I 
really would
> like data/time data types, so that would leave Gadfly out, right? 
Plus. my
> database is getting fairly large (~5 Meg), so I'm not sure I want 
to load it
> all in memory.
> 
> Thanks for any advice you can supply!
> Greg Lindstrom
> Vilonia, Arkansas
> 






---------------------------------
Do you Yahoo!?
Yahoo! News - Today's headlines
--0-1447942785-1040757891=:95725
Content-Type: text/html; charset=us-ascii

<P>I came to this group today to see what I could find on a particular <BR>ZOPE/MySQL issue I'm having. It relates to this thread, somewhat. I <BR>hope someone can give me some insight.<BR><BR>I have ZOPE installed on a WIN98 machine that is acting as a <BR>temporary server until we go through a complete network upgrade to <BR>Windows 2000 Server, et. al. I have a development workstation that is <BR>using Windows 2000 Professional. This machine is where I have <BR>installed MySQL. So, I have ZOPE on one machine and MySQL on the <BR>other. <BR><BR>I installed the myODBC from mysql.com because I couldn't get any of <BR>the ZMySQLDA/MySQLdb products to work on any version of Windows <BR>(obviously it favors the Unix/Linux environment). Well, Windows is <BR>what I'm stuck with now.<BR><BR>I created databases, set up my ODBC connections, set up my Z SQL <BR>Methods and SQL Forms (depending upon which databases I access) and <BR>can access the databases with beautiful results on my ZOPE <BR>pages......BUT.....the results are extremellllllllllllllllllllly slow <BR>in coming. Even small databases with just a few records take forever <BR>to come up even with the most basic of SQL statements using either <BR>SQL Forms (for example, my Purchase Order database):<BR></P>
<P>&lt;dtml-var standard_html_header&gt;<BR>&lt;dtml-if CheckPermissions&gt;<BR><BR>&lt;dtml-unless REFERER&gt;&lt;dtml-call "REQUEST.set<BR>('REFERER',HTTP_REFERER)"&gt;&lt;/dtml-unless&gt;<BR>&lt;dtml-unless sqf_edit_method&gt;&lt;dtml-call "REQUEST.set<BR>('sqf_edit_method','edit')"&gt;&lt;/dtml-unless&gt;<BR><BR>&lt;h3&gt;&gt; &lt;dtml-var title_or_id&gt;: &lt;dtml-var document_title&gt; (List)&lt;/h3&gt;<BR>&lt;P&gt;<BR>&lt;a href="&amp;dtml-URL2;/"&gt;Up&lt;/a&gt; -<BR>&lt;a href="&amp;dtml-REFERER;"&gt;Back&lt;/a&gt; -<BR>&lt;a href="list?REFERER=&amp;dtml-REFERER;"&gt;List&lt;/a&gt; -<BR>&lt;a href="add?REFERER=&amp;dtml-REFERER;"&gt;Add&lt;/a&gt;<BR><BR>&lt;br&gt;&lt;br&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&lt;table CELLSPACING='&amp;dtml-table_cell_spacing;'&gt;<BR>&lt;tr BGCOLOR='&amp;dtml-internal_title_color;'&gt;<BR> &lt;th&gt;P.O.#&lt;/th&gt;<BR> &lt;th&gt;Order Date&lt;/th&gt;<BR> &lt;th&gt;P.O. Vendor&lt;/th&gt;<BR> &lt;th&gt;Items&lt;/th&gt;<BR> &lt;th&gt;Terms&lt;/th&gt;<BR> &lt;th&gt;Total&lt;/th&gt;<BR>&lt;/tr&gt;<BR><BR><BR>&lt;dtml-call "REQUEST.set('bat_size',_.int(viewlistlen))"&gt;<BR>&lt;dtml-unless start_key&gt;&lt;dtml-call "REQUEST.set('start_key',0)"&gt;&lt;/dtml-<BR>unless&gt;<BR>&lt;dtml-if "_.int(start_key)&lt;0"&gt;&lt;dtml-call "REQUEST.set<BR>('start_key',0)"&gt;&lt;/dtml-if&gt;<BR>&lt;dtml-call "REQUEST.set('next_key',_.int(start_key))"&gt;<BR><BR>&lt;dtml-call "REQUEST.set('flag',0)"&gt;<BR><BR>&lt;dtml-call "REQUEST.set('q','select * from po2002 where autoid <BR>&gt;= '+_.str(start_key)+' order by autoid asc')"&gt;<BR><BR><BR>&lt;dtml-try&gt;<BR>&lt;dtml-in "SQL(q=q)" size=bat_size&gt;<BR>&lt;dtml-if "_.int(next_key) &lt; _.int(autoid)"&gt;<BR>&nbsp; &lt;dtml-call "REQUEST.set('next_key',autoid)"&gt;<BR>&lt;/dtml-if&gt;<BR><BR>&lt;tr valign="top" align="left" BGCOLOR='&lt;dtml-if "_.int(flag)<BR>==1"&gt;&amp;dtml-internal_c1_color;&lt;dtml-else&gt;&amp;dtml-<BR>internal_c2_color;&lt;/dtml-if&gt;'&gt;<BR><BR> &lt;td&gt;&lt;a href="&amp;dtml-sqf_edit_method;?edit_key=&lt;dtml-var <BR>autoid&gt;&amp;REFERER=&amp;dtml-REFERER;"&gt;&lt;dtml-var autoid&gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;td&gt;&lt;dtml-var order_date&gt;&lt;/td&gt;<BR> &lt;td&gt;&lt;dtml-var vendor_name&gt;&lt;/td&gt;<BR> &lt;td&gt;&lt;dtml-var items&gt;&lt;/td&gt;<BR> &lt;td&gt;&lt;dtml-var terms&gt;&lt;/td&gt;<BR> &lt;td&gt;&lt;dtml-var total&gt;&lt;/td&gt;<BR>&lt;/tr&gt;<BR>&lt;dtml-call "REQUEST.set('flag',1-_.int(flag))"&gt;<BR>&lt;/dtml-in&gt;<BR><BR>&lt;dtml-except&gt;<BR>&nbsp; &lt;h1&gt;General error&lt;/h1&gt;<BR>&nbsp; &lt;dtml-var errorinternalmethod&gt;<BR>&lt;/dtml-try&gt;<BR><BR>&lt;/table&gt;<BR>&lt;!-- navigation links --&gt;<BR>&lt;br&gt;<BR>&lt;a href="&amp;dtml-URL0;?start_key=0&amp;REFERER=&amp;dtml-REFERER;"&gt;First&lt;/a&gt; -<BR>&lt;a href="&amp;dtml-URL0;?start_key=&lt;dtml-var "_.int(start_key)-_.int<BR>(bat_size)"&gt;&amp;REFERER=&amp;dtml-REFERER;"&gt;Prev&lt;/a&gt; -<BR>&lt;a href="&amp;dtml-URL0;?start_key=&lt;dtml-var "_.int<BR>(next_key)"&gt;&amp;REFERER=&amp;dtml-REFERER;"&gt;Next&lt;/a&gt;<BR><BR>&lt;dtml-else&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;dtml-var standard_html_header&gt;<BR>&lt;/dtml-if&gt;<BR>&lt;dtml-var standard_html_footer&gt;<BR></P>
<P>and then Z SQL Methods (for example, a document log database):<BR><BR>Example 1:<BR><BR>select * from yr2000 <BR><BR>Example 2:<BR><BR>SELECT * FROM yr2000 WHERE doc_author='JEF'<BR><BR>I also tried to set up a search form so users can perform searches <BR>themselves instead of having to be limited to choosing from pre-<BR>constructed reports I provide them. It's <BR>daaaaaaaaaaaaaaawwwwwwwwwwwwwwwggggggggggggggg slowwwwwwwwwwwwwwwww <BR>though. I even went so far as to perform table structure tests on my <BR>MySQL databases to ensure I was optimizing them for the fastest <BR>performance. Any searches done through a MySQL client returns quick <BR>results but I want all of their access to these databases to be web-<BR>based (i.e., through ZOPE site). Help!<BR><BR>Thanks.<BR>Deb<BR><BR><BR>--- In zope@yahoogroups.com, "Bryan Capitano" <BRYAN@C...>wrote:<BR>&gt; There are several options to using Zope+MySQL on the same Windows <BR>box. I<BR>&gt; have not done this in a production server environment, so I can't <BR>say how<BR>&gt; well that would work. But for development purposes, it works just <BR>fine.<BR>&gt; <BR>&gt; I had some problems getting python-MySQL adapter to install on <BR>Windows and<BR>&gt; recognize my python installation (because I was trying to install <BR>MySQLDA).<BR>&gt; But there are two ways around this problem which I've learned:<BR>&gt; (1) One is to install MyODBC (see www.mysql.com) and create a <BR>System ODBC<BR>&gt; database for your MySQL database. Then install the MyODBCDA <BR>database adapter<BR>&gt; for Zope (instead of MySQLDA). This allows you to talk to MySQL <BR>through an<BR>&gt; ODBC bridge. This solution works like a charm.<BR>&gt; (2) The second workaround is to install Python2.1.3 on your machine<BR>&gt; separately from the Windows Zope installation. Then install the .exe<BR>&gt; Mysql-Python package (www.sourceforge.net). Then copy the installed <BR>files to<BR>&gt; the Zope/Python directory. Then install MySQLDa. This solution was <BR>provided<BR>&gt; to me by another list member (hiren_hindocha@a...).<BR>&gt; <BR>&gt; <BR><BR>&gt; -----Original Message-----<BR>&gt; From: zope-admin@z... [mailto:zope-admin@z...]On Behalf Of Greg &amp;<BR>&gt; Janet LINDSTROM<BR>&gt; Sent: Saturday, November 02, 2002 7:41 AM<BR>&gt; To: zope@z...<BR>&gt; Subject: [Zope] Zope and MySQL on Windows<BR>&gt; <BR>&gt; <BR>&gt; Greetings-<BR>&gt; I have a fairly mature Python application which uses MySQL for the <BR>database.<BR>&gt; I would like to switch over from a single machine application to a <BR>web based<BR>&gt; app (and maybe even make some money!!), and thought Zope would be <BR>the<BR>&gt; logical choice. The past 2 weeks have had me running through the <BR>examples<BR>&gt; in the Zope book and the Zope "Bible", and I *think* I am ready to <BR>create a<BR>&gt; project. Then I read the the creators of Zope do not reccommend <BR>using MySQL<BR>&gt; with Zope on a Windows box. Rats! So...<BR>&gt; 1. Is this still sound advice?<BR>&gt; 2. If so, what other Open Source Database is out there. I <BR>really would<BR>&gt; like data/time data types, so that would leave Gadfly out, right? <BR>Plus. my<BR>&gt; database is getting fairly large (~5 Meg), so I'm not sure I want <BR>to load it<BR>&gt; all in memory.<BR>&gt; <BR>&gt; Thanks for any advice you can supply!<BR>&gt; Greg Lindstrom<BR>&gt; Vilonia, Arkansas<BR>&gt; <BR><BR><BR></P><p><br><hr size=1>Do you Yahoo!?<br>
<b><a href="http://news.yahoo.com/">Yahoo! News</a></b> - Today's headlines
--0-1447942785-1040757891=:95725--