Re: [Zope] MySQL-python-1.2.2 ImportError

2009-01-21 Thread Michael Backhaus
Well, I guess it was my bet ... solaris uses 'crle' for the ld
configuration. I included the mysql-lib directory and it seems to work
now.

On Wed, 2009-01-21 at 06:20 +0530, Chetan Kumar wrote:
 On Wed, Jan 21, 2009 at 3:19 AM, SolidEther solidet...@gmx.net wrote:
  ImportError: ld.so.1: python: fatal: libmysqlclient_r.so.16: open
  failed: No such file or directory
 
 Take care to compile MySQL with thread-safe option.
 Cheers

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL-python-1.2.2 ImportError

2009-01-20 Thread SolidEther
Hi Everyone,

I am having trouble to make use of a compiled version of MySQL- 
python-1.2.2 with Zope/Python under OpenSolaris snv_101b.

I installed Zope/Plone (running) and need mysql-python to be compiled  
with the python version (2.4) that came with zope. I further compiled  
MySQL 5.1.30 and it is running fine.

MySQL-python-1.2.2 actually builds and installs fine:

[...]
Installed /opt/Plone-3.1/Python-2.4/lib/python2.4/site-packages/ 
MySQL_python-1.2.2-py2.4-solaris-2.11-i86pc.egg
[...]

But when I want to test the module with the zope-pyhton, I get this  
error:

  import MySQLdb
Traceback (most recent call last):
  File stdin, line 1, in ?
  File build/bdist.solaris-2.11-i86pc/egg/MySQLdb/__init__.py, line  
19, in ?
  File build/bdist.solaris-2.11-i86pc/egg/_mysql.py, line 7, in ?
  File build/bdist.solaris-2.11-i86pc/egg/_mysql.py, line 6, in  
__bootstrap__
ImportError: ld.so.1: python: fatal: libmysqlclient_r.so.16: open  
failed: No such file or directory

Having a look at sys.path reveals:

  print sys.path
['/opt/Plone-3.1/Python-2.4/lib/python2.4/site-packages/ 
setuptools-0.6c8-py2.4.egg', '/opt/Plone-3.1/Python-2.4/lib/python2.4/ 
site-packages/PILwoTk-1.1.6.3-py2.4-solaris-2.11-i86pc.egg', '/opt/ 
Plone-3.1/Python-2.4/lib/python2.4/site-packages/Cheetah-2.0.1-py2.4- 
solaris-2.11-i86pc.egg', '/opt/Plone-3.1/Python-2.4/lib/python2.4/site- 
packages/Paste-1.6-py2.4.egg', '/opt/Plone-3.1/Python-2.4/lib/ 
python2.4/site-packages/PasteDeploy-1.3.1-py2.4.egg', '/opt/Plone-3.1/ 
Python-2.4/lib/python2.4/site-packages/PasteScript-1.6.2-py2.4.egg', '/ 
opt/Plone-3.1/Python-2.4/lib/python2.4/site-packages/ZopeSkel-1.8- 
py2.4.egg', '/opt/Plone-3.1/Python-2.4/lib/python2.4/site-packages/ 
MySQL_python-1.2.2-py2.4-solaris-2.11-i86pc.egg', '', '/opt/Plone-3.1/ 
Python-2.4/lib/python24.zip', '/opt/Plone-3.1/Python-2.4/lib/ 
python2.4', '/opt/Plone-3.1/Python-2.4/lib/python2.4/plat-sunos5', '/ 
opt/Plone-3.1/Python-2.4/lib/python2.4/lib-tk', '/opt/Plone-3.1/ 
Python-2.4/lib/python2.4/lib-dynload', '/opt/Plone-3.1/Python-2.4/lib/ 
python2.4/site-packages']

and further checking for 'libmysqlclient_r.so.16' (I added that sym- 
link later on):

# ll /opt/Plone-3.1/Python-2.4/lib/python2.4/libmysqlclient_r.so.16
lrwxrwxrwx   1 root root  43 Jan 20 17:46 /opt/Plone-3.1/ 
Python-2.4/lib/python2.4/libmysqlclient_r.so.16 - /opt/mysql/mysql/ 
lib/libmysqlclient_r.so.16*
# ll /opt/mysql/mysql/lib/libmysqlclient_r.so.16
lrwxrwxrwx   1 root root  47 Dec 18 12:07 /opt/mysql/mysql/ 
lib/libmysqlclient_r.so.16 - /opt/mysql/mysql/lib/libmysqlclient_r.so. 
16.0.0*
# ll /opt/mysql/mysql/lib/libmysqlclient_r.so.16.0.0
-rwxr-xr-x   1 root bin  5632336 Nov 15 20:35 /opt/mysql/mysql/ 
lib/libmysqlclient_r.so.16.0.0*

So, actually everything is there. I am running out of ideas here.

Any suggestions of how I could get this working?

Thx  Cheers,
Michael
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] mysql and LOAD DATA INFILE

2008-10-15 Thread Andreas Jung

On 15.10.2008 13:16 Uhr, [EMAIL PROTECTED] wrote:

hello everybody!

this is a 50%zope and 50%mysql question..hope somebody here will help me..:-)

in PC1: are running a mysql and zope+Plone server. A zsql method imports a csv
file into mysql using a LOAD DATA LOCAL INFILE and all runs OK when the file
is in the PC1 filesystem.

I know that LOCAL is from the mysql server's point of view, in this
case LOCAL should mean where the mysql client is running (the zope web
server)

Is there a way to let a remote Plone user (on a remote host) to enter his
local file into the remote mysql server?

I guess that the issue is entirely on the mysql side, but hope that zope will
offer some kind of solution.



Not sure what the background of your question is. According to the docs: 
LOAD DATA INLINE will read a file from the client host. So you must 
ensure that the data file is available on the machine where Plone/Zope 
is running. Where is the problem with that?


-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd.  Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] mysql and LOAD DATA INFILE

2008-10-15 Thread tangonights
hello everybody!

this is a 50%zope and 50%mysql question..hope somebody here will help me..:-)

in PC1: are running a mysql and zope+Plone server. A zsql method imports a csv 
file into mysql using a LOAD DATA LOCAL INFILE and all runs OK when the file 
is in the PC1 filesystem.

I know that LOCAL is from the mysql server's point of view, in this 
case LOCAL should mean where the mysql client is running (the zope web 
server)

Is there a way to let a remote Plone user (on a remote host) to enter his 
local file into the remote mysql server?

I guess that the issue is entirely on the mysql side, but hope that zope will 
offer some kind of solution.

hope to have been clear enough..
thanks,
Stefano.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL reconnects on zope application level

2008-07-17 Thread Jonas Meurer
On 16/07/2008 Peter Bengtsson wrote:
 I don't have an easy answer but if you do dig into Andy's code and try
 to implement this, I would suggest you look at the ZPsycopgDA code
 perhaps and look for inspiration since I think that one works much
 better.

Thanks, but finally I found an easier solution :-)

the 3.0 beta1 of ZMySQLDA seems to have this fixed. It doesn't allow to
configure automatic reconnects, but it implements them defaultly.

thanks for your help,

greetings,
 jonas
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL reconnects on zope application level

2008-07-16 Thread Jonas
Hello,

On several zope 2.10.6 instances we discovered issues with database
connections to MySQL. Apparently MySQL seems to not automaticly
reconnect connections with a timeout since version 5.0.3 due to issues
with transactions.

Until now, mysql-python was patched to restore that behaviour to
automatically reconnect timeouted connections, but that is not the case
anymore either.

So from now on the database reconnects need to be done from zope
applications on their own. Unfortunately the ZMySQLda adapter by Andy
Dustman doesn't implement such a functionality.

I cannot imagine that we are the only ones who discover this problem. Is
there an easy way to implement automatic reconnects for Z MySQL Database
Connections on zope application level?

greetings, and thanks in advance,
 jonas
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL reconnects on zope application level

2008-07-16 Thread Peter Bengtsson
I don't have an easy answer but if you do dig into Andy's code and try
to implement this, I would suggest you look at the ZPsycopgDA code
perhaps and look for inspiration since I think that one works much
better.


2008/7/16 Jonas [EMAIL PROTECTED]:
 Hello,

 On several zope 2.10.6 instances we discovered issues with database
 connections to MySQL. Apparently MySQL seems to not automaticly
 reconnect connections with a timeout since version 5.0.3 due to issues
 with transactions.

 Until now, mysql-python was patched to restore that behaviour to
 automatically reconnect timeouted connections, but that is not the case
 anymore either.

 So from now on the database reconnects need to be done from zope
 applications on their own. Unfortunately the ZMySQLda adapter by Andy
 Dustman doesn't implement such a functionality.

 I cannot imagine that we are the only ones who discover this problem. Is
 there an easy way to implement automatic reconnects for Z MySQL Database
 Connections on zope application level?

 greetings, and thanks in advance,
  jonas
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )




-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Hugo Ramos
Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt [EMAIL PROTECTED] wrote:
 Hi Hugo. I believe 'file is not of required architecture' may be the
  clue here. Ever since mac went to universal binaries, folks with ppc
  have been having trouble since it is compiled with i386 arch flags and
  vice versa for folks with intel macs (with ppc arch flags). The only way
  to get around this is to compile a universal build, use universal
  binaries, or build for your own architecture. There is a large amount of
  software out there that does not do the right thing.

  For myself, I build my own software including python and I try and keep
  away from the universal insanity. On a mac, many folks use macports
  without the universal build. If you choose to build your own software,
  you can place it in the /opt directory to prevent it from affecting your
  system software. This is where your macports software will go if you use
  it. You will also need to modify your path to ensure that your compiled
  software is obtained over system software.

  I see that your issue was solved with a universal build. This probably
  just confirms what I have written. This may be alright until you run
  into the next snag with something else you need to compile. Personally,
  I got tired of the consistent problems trying to build software with the
  universal python.

  Regards,
  David



  Hugo Ramos wrote:
   Hello Chetan,
  
   Well thank you very much! I must be very tired to forget to compile
   MySQL without --enable-thread-safe-client !!!
   It seems that MySQL-python now compiles with a warning:
  
   ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
   is not of required architecture
  
   But when I try to import _mysql in Python 2.4.4 shell it seems to
   import the module with no errors.
  
   After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
   receive the following error:
  
   ===
   2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
   Traceback (most recent call last):
 File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   709, in import_product
   product=__import__(pname, global_dict, global_dict, silly)
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
   line 91, in ?
   import DA
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, 
 in ?
   from db import DB
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, 
 in ?
   import _mysql
 File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
 File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in 
 __bootstrap__
   ImportError: Inappropriate file type for dynamic loading
   Traceback (most recent call last):
 File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, 
 in ?
   run()
 File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, 
 in run
   starter.prepare()
 File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
   line 102, in prepare
   self.startZope()
 File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
   line 278, in startZope
   Zope2.startup()
 File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in 
 startup
   _startup()
 File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
   45, in startup
   OFS.Application.import_products()
 File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   686, in import_products
   import_product(product_dir, product_name, raise_exc=debug_mode)
 File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   709, in import_product
   product=__import__(pname, global_dict, global_dict, silly)
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
   line 91, in ?
   import DA
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, 
 in ?
   from db import DB
 File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, 
 in ?
   import _mysql
 File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
 File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in 
 __bootstrap__
   ImportError: Inappropriate file type for dynamic loading
   ===
  
   Any ideas?
  
   ps: I'm posting this to zope list because I'm sure there is more
   people with this problem.
  
  
   tia
  
   Hugo
  
  
   On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:
   Hello
   I understand.
   If I could take the risk of telling-the-obvious what you need to do
   is to recompile mysql so that mysqlclient_r libraries are also
   created.
   --enable-thread-safe-client is to be used 

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread David Pratt
Hi Hugo. Yes, that's true but of course you have to consider all of the 
other frameworks that apple has already put on your machine. Much of the 
problem will come when linking the libraries when compiling. So in fact 
it is a bigger issue and requires much of the base software to 
recompiled using macports or on your own for a sound development 
machine. You can of course recompile these to create a framework build 
for your own architecture.


You probably just need to keep in mind that mac is really only just 
FreeBSD/Darwin so things will compile in a normal mode without anything 
'universal' involved. I just takes some effort.


Regards,
David

Hugo Ramos wrote:

Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt [EMAIL PROTECTED] wrote:

Hi Hugo. I believe 'file is not of required architecture' may be the
 clue here. Ever since mac went to universal binaries, folks with ppc
 have been having trouble since it is compiled with i386 arch flags and
 vice versa for folks with intel macs (with ppc arch flags). The only way
 to get around this is to compile a universal build, use universal
 binaries, or build for your own architecture. There is a large amount of
 software out there that does not do the right thing.

 For myself, I build my own software including python and I try and keep
 away from the universal insanity. On a mac, many folks use macports
 without the universal build. If you choose to build your own software,
 you can place it in the /opt directory to prevent it from affecting your
 system software. This is where your macports software will go if you use
 it. You will also need to modify your path to ensure that your compiled
 software is obtained over system software.

 I see that your issue was solved with a universal build. This probably
 just confirms what I have written. This may be alright until you run
 into the next snag with something else you need to compile. Personally,
 I got tired of the consistent problems trying to build software with the
 universal python.

 Regards,
 David



 Hugo Ramos wrote:
  Hello Chetan,
 
  Well thank you very much! I must be very tired to forget to compile
  MySQL without --enable-thread-safe-client !!!
  It seems that MySQL-python now compiles with a warning:
 
  ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
  is not of required architecture
 
  But when I try to import _mysql in Python 2.4.4 shell it seems to
  import the module with no errors.
 
  After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
  receive the following error:
 
  ===
  2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
  Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
  line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, 
in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, 
in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
  ImportError: Inappropriate file type for dynamic loading
  Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in ?
  run()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in 
run
  starter.prepare()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
  line 102, in prepare
  self.startZope()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
  line 278, in startZope
  Zope2.startup()
File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in 
startup
  _startup()
File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
  45, in startup
  OFS.Application.import_products()
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  686, in import_products
  import_product(product_dir, product_name, raise_exc=debug_mode)
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
  line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, 
in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, 
in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File 

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Tino Wildenhain

Hugo Ramos wrote:

Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).


You could also forward to Postgres :-) Unless you have a very specific
need for mysql...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Hey Kumar,

I like to think that the amount of time I could make anyone here spend
looking for something is VERY well spent.
That link you sent me is just 1 of the about 50 I searched on google
before posting the problem. :-)

I can tell you now that cp, mv and ln are not the solution.
I can also tell you that there's someone posting this and the patch to
MySQL-python sourceforge site as a bug in the setup_posix.py file
(which didn't solve my problem)

Finally I can also tell you that after compiling MySQL 5.0.51a from
source my /usr/local/mysql/lib and /usr/local/mysql/lib/mysql look
like this:

$ dir /usr/local/mysql/lib/
total 0
drwxr-xr-x   3 root  wheel  102 Feb 20 01:55 .
drwxr-xr-x  11 root  wheel  374 Feb 20 01:56 ..
drwxr-xr-x  14 root  wheel  476 Feb 20 01:55 mysql

$ dir /usr/local/mysql/lib/mysql/
total 3616
drwxr-xr-x  14 root  wheel 476 Feb 20 01:55 .
drwxr-xr-x   3 root  wheel 102 Feb 20 01:55 ..
-rw-r--r--   1 root  wheel   12168 Feb 20 01:55 libdbug.a
-rw-r--r--   1 root  wheel   40048 Feb 20 01:55 libheap.a
-rw-r--r--   1 root  wheel  351896 Feb 20 01:55 libmyisam.a
-rw-r--r--   1 root  wheel   21128 Feb 20 01:55 libmyisammrg.a
-rwxr-xr-x   1 root  wheel  375120 Feb 20 01:55 libmysqlclient.15.0.0.dylib
lrwxr-xr-x   1 root  wheel  27 Feb 20 01:55
libmysqlclient.15.dylib - libmysqlclient.15.0.0.dylib
-rw-r--r--   1 root  wheel  492440 Feb 20 01:55 libmysqlclient.a
lrwxr-xr-x   1 root  wheel  27 Feb 20 01:55 libmysqlclient.dylib
- libmysqlclient.15.0.0.dylib
-rwxr-xr-x   1 root  wheel 877 Feb 20 01:55 libmysqlclient.la
-rw-r--r--   1 root  wheel  262088 Feb 20 01:55 libmystrings.a
-rw-r--r--   1 root  wheel  262940 Feb 20 01:55 libmysys.a
-rw-r--r--   1 root  wheel5848 Feb 20 01:55 libvio.a

I run out of ideas now... after 3 days searching and testing... HELP
would be much appreciated.

Thanks guys


On Feb 20, 2008 3:08 AM, Chetan Kumar [EMAIL PROTECTED] wrote:
 Discussion and solution here
 http://forums.mysql.com/read.php?50,175059,180049
 Cheers!!!
 Chetan




-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Hello Chetan,

Well thank you very much! I must be very tired to forget to compile
MySQL without --enable-thread-safe-client !!!
It seems that MySQL-python now compiles with a warning:

ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture

But when I try to import _mysql in Python 2.4.4 shell it seems to
import the module with no errors.

After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
receive the following error:

===
2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
Traceback (most recent call last):
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
line 91, in ?
import DA
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in ?
from db import DB
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in ?
import _mysql
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
Traceback (most recent call last):
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in ?
run()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in run
starter.prepare()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
line 102, in prepare
self.startZope()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
line 278, in startZope
Zope2.startup()
  File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in startup
_startup()
  File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
45, in startup
OFS.Application.import_products()
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
686, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
line 91, in ?
import DA
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in ?
from db import DB
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in ?
import _mysql
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
===

Any ideas?

ps: I'm posting this to zope list because I'm sure there is more
people with this problem.


tia

Hugo


On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:
 Hello
 I understand.
 If I could take the risk of telling-the-obvious what you need to do
 is to recompile mysql so that mysqlclient_r libraries are also
 created.
 --enable-thread-safe-client is to be used while configuring the mysql
 installation.
 If that is done already, the LD_LIBRARY_PATH (or equivalent in your
 case) if to set appropriately so that lmysqlclient_r is available for
 linking.
 Good luck
 Chetan




-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager

~~ @ ~~
http://www.orkut.com/Profile.aspx?uid=10082105466310142690
http://otuggapoesia.blogspot.com/
http://otugga.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).

omg...


Thanks
Hugo


On Feb 20, 2008 12:31 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
 Hello Chetan,

 Well thank you very much! I must be very tired to forget to compile
 MySQL without --enable-thread-safe-client !!!
 It seems that MySQL-python now compiles with a warning:

 ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
 is not of required architecture

 But when I try to import _mysql in Python 2.4.4 shell it seems to
 import the module with no errors.

 After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
 receive the following error:

 ===
 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
 Traceback (most recent call last):
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 709, in import_product
 product=__import__(pname, global_dict, global_dict, silly)
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
 line 91, in ?
 import DA
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in 
 ?
 from db import DB
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in 
 ?
 import _mysql
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
 ImportError: Inappropriate file type for dynamic loading
 Traceback (most recent call last):
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in ?
 run()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in 
 run
 starter.prepare()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
 line 102, in prepare
 self.startZope()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
 line 278, in startZope
 Zope2.startup()
   File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in 
 startup
 _startup()
   File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
 45, in startup
 OFS.Application.import_products()
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 686, in import_products
 import_product(product_dir, product_name, raise_exc=debug_mode)
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 709, in import_product
 product=__import__(pname, global_dict, global_dict, silly)
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
 line 91, in ?
 import DA
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in 
 ?
 from db import DB
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in 
 ?
 import _mysql
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
 ImportError: Inappropriate file type for dynamic loading
 ===

 Any ideas?

 ps: I'm posting this to zope list because I'm sure there is more
 people with this problem.


 tia

 Hugo



 On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:
  Hello
  I understand.
  If I could take the risk of telling-the-obvious what you need to do
  is to recompile mysql so that mysqlclient_r libraries are also
  created.
  --enable-thread-safe-client is to be used while configuring the mysql
  installation.
  If that is done already, the LD_LIBRARY_PATH (or equivalent in your
  case) if to set appropriately so that lmysqlclient_r is available for
  linking.
  Good luck
  Chetan
 



 --
 Hugo Ramos - [EMAIL PROTECTED]
 IT Project Manager

 ~~ @ ~~
 http://www.orkut.com/Profile.aspx?uid=10082105466310142690
 http://otuggapoesia.blogspot.com/
 http://otugga.blogspot.com/




-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager

~~ @ ~~
http://www.orkut.com/Profile.aspx?uid=10082105466310142690
http://otuggapoesia.blogspot.com/
http://otugga.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Where did you get that file? MySQL-Python at sourceforge?


Thanks


On Feb 20, 2008 5:28 PM, Giampiero Benvenuti
[EMAIL PROTECTED] wrote:
 I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It works
 just fine.

 Giampiero



 On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:


 Well,

 I went googling for this error... Google gives 1 (one) answer!!! The
 worst part is that it's related to django and mod_python.

 I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).

 omg...


 Thanks
 Hugo


 On Feb 20, 2008 12:31 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
 Hello Chetan,

 Well thank you very much! I must be very tired to forget to compile
 MySQL without --enable-thread-safe-client !!!
 It seems that MySQL-python now compiles with a warning:

 ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
 is not of required architecture

 But when I try to import _mysql in Python 2.4.4 shell it seems to
 import the module with no errors.

 After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
 receive the following error:

 ===
 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
 Traceback (most recent call last):
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 709, in import_product
 product=__import__(pname, global_dict, global_dict, silly)
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
 line 91, in ?
 import DA
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92,
 in ?
 from db import DB
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89,
 in ?
 import _mysql
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
 ImportError: Inappropriate file type for dynamic loading
 Traceback (most recent call last):
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in
 ?
 run()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in
 run
 starter.prepare()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
 line 102, in prepare
 self.startZope()
   File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
 line 278, in startZope
 Zope2.startup()
   File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in
 startup
 _startup()
   File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
 45, in startup
 OFS.Application.import_products()
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 686, in import_products
 import_product(product_dir, product_name, raise_exc=debug_mode)
   File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
 709, in import_product
 product=__import__(pname, global_dict, global_dict, silly)
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
 line 91, in ?
 import DA
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92,
 in ?
 from db import DB
   File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89,
 in ?
 import _mysql
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
   File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
 ImportError: Inappropriate file type for dynamic loading
 ===

 Any ideas?

 ps: I'm posting this to zope list because I'm sure there is more
 people with this problem.


 tia

 Hugo



 On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:

 Hello

 I understand.

 If I could take the risk of telling-the-obvious what you need to do

 is to recompile mysql so that mysqlclient_r libraries are also

 created.

 --enable-thread-safe-client is to be used while configuring the mysql

 installation.

 If that is done already, the LD_LIBRARY_PATH (or equivalent in your

 case) if to set appropriately so that lmysqlclient_r is available for

 linking.

 Good luck

 Chetan





 --
 Hugo Ramos - [EMAIL PROTECTED]
 IT Project Manager

 ~~ @ ~~
 http://www.orkut.com/Profile.aspx?uid=10082105466310142690
 http://otuggapoesia.blogspot.com/
 http://otugga.blogspot.com/




 --
 Hugo Ramos - [EMAIL PROTECTED]
 IT Project Manager

 ~~ @ ~~
 http://www.orkut.com/Profile.aspx?uid=10082105466310142690
 http://otuggapoesia.blogspot.com/
 http://otugga.blogspot.com/
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Forget it... Just found the file at:
http://pythonmac.org/packages/py24-fat/index.html


Thanks a lot!
Hugo


On Feb 20, 2008 5:57 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
 Where did you get that file? MySQL-Python at sourceforge?


 Thanks


 On Feb 20, 2008 5:28 PM, Giampiero Benvenuti

 [EMAIL PROTECTED] wrote:
  I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It works
  just fine.
 
  Giampiero
 
 
 
  On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:
 
 
  Well,
 
  I went googling for this error... Google gives 1 (one) answer!!! The
  worst part is that it's related to django and mod_python.
 
  I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).
 
  omg...
 
 
  Thanks
  Hugo
 
 
  On Feb 20, 2008 12:31 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
  Hello Chetan,
 
  Well thank you very much! I must be very tired to forget to compile
  MySQL without --enable-thread-safe-client !!!
  It seems that MySQL-python now compiles with a warning:
 
  ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
  is not of required architecture
 
  But when I try to import _mysql in Python 2.4.4 shell it seems to
  import the module with no errors.
 
  After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
  receive the following error:
 
  ===
  2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
  Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
  line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92,
  in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89,
  in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
  ImportError: Inappropriate file type for dynamic loading
  Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in
  ?
  run()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in
  run
  starter.prepare()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
  line 102, in prepare
  self.startZope()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
  line 278, in startZope
  Zope2.startup()
File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in
  startup
  _startup()
File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
  45, in startup
  OFS.Application.import_products()
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  686, in import_products
  import_product(product_dir, product_name, raise_exc=debug_mode)
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
  709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
  line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92,
  in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89,
  in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
  ImportError: Inappropriate file type for dynamic loading
  ===
 
  Any ideas?
 
  ps: I'm posting this to zope list because I'm sure there is more
  people with this problem.
 
 
  tia
 
  Hugo
 
 
 
  On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:
 
  Hello
 
  I understand.
 
  If I could take the risk of telling-the-obvious what you need to do
 
  is to recompile mysql so that mysqlclient_r libraries are also
 
  created.
 
  --enable-thread-safe-client is to be used while configuring the mysql
 
  installation.
 
  If that is done already, the LD_LIBRARY_PATH (or equivalent in your
 
  case) if to set appropriately so that lmysqlclient_r is available for
 
  linking.
 
  Good luck
 
  Chetan
 
 
 
 
 
  --
  Hugo Ramos - [EMAIL PROTECTED]
  IT Project Manager
 
  ~~ @ ~~
  http://www.orkut.com/Profile.aspx?uid=10082105466310142690
  http://otuggapoesia.blogspot.com/
  http://otugga.blogspot.com/
 
 
 
 
  --
  Hugo Ramos - [EMAIL PROTECTED]
  IT Project Manager
 
  ~~ @ ~~
  http://www.orkut.com/Profile.aspx?uid=10082105466310142690
  http://otuggapoesia.blogspot.com/
  http://otugga.blogspot.com/
  ___
  Zope maillist  -  Zope@zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Man...

I should buy you a drink at Lisbon when you decide to come here!!! :-)
The binary package works fine now!

I just wish someone would answer about the compilation warning and
import error in Zope.


Thank you very much
Really appreciated

Hugo


On Wed, Feb 20, 2008 at 8:47 PM, Giampiero Benvenuti
[EMAIL PROTECTED] wrote:
 does it work?



  On Feb 20, 2008, at 10:07 AM, Hugo Ramos wrote:

   Forget it... Just found the file at:
   http://pythonmac.org/packages/py24-fat/index.html
  
  
   Thanks a lot!
   Hugo
  
  
   On Feb 20, 2008 5:57 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
   Where did you get that file? MySQL-Python at sourceforge?
  
  
   Thanks
  
  
   On Feb 20, 2008 5:28 PM, Giampiero Benvenuti
  
   [EMAIL PROTECTED] wrote:
   I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It
   works
   just fine.
  
   Giampiero
  
  
  
   On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:
  
  
   Well,
  
   I went googling for this error... Google gives 1 (one) answer!!! The
   worst part is that it's related to django and mod_python.
  
   I guess nobody solved this yet... I'll have to go back to OS X
   10.4 (Tiger).
  
   omg...
  
  
   Thanks
   Hugo
  
  
   On Feb 20, 2008 12:31 PM, Hugo Ramos [EMAIL PROTECTED] wrote:
   Hello Chetan,
  
   Well thank you very much! I must be very tired to forget to compile
   MySQL without --enable-thread-safe-client !!!
   It seems that MySQL-python now compiles with a warning:
  
   ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib,
   file
   is not of required architecture
  
   But when I try to import _mysql in Python 2.4.4 shell it seems to
   import the module with no errors.
  
   After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
   receive the following error:
  
   ===
   2008-02-20 11:41:52 ERROR Application Could not import
   Products.ZMySQLDA
   Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/
   __init__.py,
   line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py,
   line 92,
   in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py,
   line 89,
   in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in
   __bootstrap__
   ImportError: Inappropriate file type for dynamic loading
   Traceback (most recent call last):
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py,
   line 56, in
   ?
  run()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py,
   line 21, in
   run
  starter.prepare()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
   line 102, in prepare
  self.startZope()
File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
   line 278, in startZope
  Zope2.startup()
File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line
   47, in
   startup
  _startup()
File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
   45, in startup
  OFS.Application.import_products()
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   686, in import_products
  import_product(product_dir, product_name, raise_exc=debug_mode)
File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
   709, in import_product
  product=__import__(pname, global_dict, global_dict, silly)
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/
   __init__.py,
   line 91, in ?
  import DA
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py,
   line 92,
   in ?
  from db import DB
File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py,
   line 89,
   in ?
  import _mysql
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in
   __bootstrap__
   ImportError: Inappropriate file type for dynamic loading
   ===
  
   Any ideas?
  
   ps: I'm posting this to zope list because I'm sure there is more
   people with this problem.
  
  
   tia
  
   Hugo
  
  
  
   On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED]
   wrote:
  
   Hello
  
   I understand.
  
   If I could take the risk of telling-the-obvious what you need to
   do
  
   is to recompile mysql so that mysqlclient_r libraries are also
  
   created.
  
   --enable-thread-safe-client is to be used while configuring the
   mysql
  
   installation.
  
   If that is done already, the LD_LIBRARY_PATH (or equivalent in your
  
   case) if to set appropriately so that lmysqlclient_r is available
   for
  
   linking.
  
   Good luck
  
   Chetan
  
  
  
  
  
   --
   Hugo Ramos - [EMAIL PROTECTED]
   

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread David Pratt
Hi Hugo. I believe 'file is not of required architecture' may be the 
clue here. Ever since mac went to universal binaries, folks with ppc 
have been having trouble since it is compiled with i386 arch flags and 
vice versa for folks with intel macs (with ppc arch flags). The only way 
to get around this is to compile a universal build, use universal 
binaries, or build for your own architecture. There is a large amount of 
software out there that does not do the right thing.


For myself, I build my own software including python and I try and keep 
away from the universal insanity. On a mac, many folks use macports 
without the universal build. If you choose to build your own software, 
you can place it in the /opt directory to prevent it from affecting your 
system software. This is where your macports software will go if you use 
it. You will also need to modify your path to ensure that your compiled 
software is obtained over system software.


I see that your issue was solved with a universal build. This probably 
just confirms what I have written. This may be alright until you run 
into the next snag with something else you need to compile. Personally, 
I got tired of the consistent problems trying to build software with the 
universal python.


Regards,
David

Hugo Ramos wrote:

Hello Chetan,

Well thank you very much! I must be very tired to forget to compile
MySQL without --enable-thread-safe-client !!!
It seems that MySQL-python now compiles with a warning:

ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture

But when I try to import _mysql in Python 2.4.4 shell it seems to
import the module with no errors.

After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
receive the following error:

===
2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
Traceback (most recent call last):
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
line 91, in ?
import DA
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in ?
from db import DB
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in ?
import _mysql
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
Traceback (most recent call last):
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 56, in ?
run()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py, line 21, in run
starter.prepare()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
line 102, in prepare
self.startZope()
  File /usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py,
line 278, in startZope
Zope2.startup()
  File /usr/local/zope2.10.5/lib/python/Zope2/__init__.py, line 47, in startup
_startup()
  File /usr/local/zope2.10.5/lib/python/Zope2/App/startup.py, line
45, in startup
OFS.Application.import_products()
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
686, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
  File /usr/local/zope2.10.5/lib/python/OFS/Application.py, line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py,
line 91, in ?
import DA
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py, line 92, in ?
from db import DB
  File /usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py, line 89, in ?
import _mysql
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 7, in ?
  File build/bdist.macosx-10.3-fat/egg/_mysql.py, line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
===

Any ideas?

ps: I'm posting this to zope list because I'm sure there is more
people with this problem.


tia

Hugo


On Feb 20, 2008 10:35 AM, Chetan Kumar [EMAIL PROTECTED] wrote:

Hello
I understand.
If I could take the risk of telling-the-obvious what you need to do
is to recompile mysql so that mysqlclient_r libraries are also
created.
--enable-thread-safe-client is to be used while configuring the mysql
installation.
If that is done already, the LD_LIBRARY_PATH (or equivalent in your
case) if to set appropriately so that lmysqlclient_r is available for
linking.
Good luck
Chetan






___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-19 Thread Hugo Ramos
Yellow ppl,

I'm having a problem I didn't have in OS X 10.4 (tiger)...

When compiling MySQL-python-1.2.2 on OS X 10.5 (leopard) I get a very
annoying error I'm not being able to solve.
I've tried moving, copying and linking libraries around but nothing
seems to work.
Anyone seen this before? Andy? :-)

Thanks

=
- Mac OS X 10.5.2 (intel)
- MySQL 5.0.51a (compiled from source)
- Python 2.4.4
- MySQL-python-1.2.2
=
$ python setup.py build
running build
running build_py
copying MySQLdb/release.py - build/lib.macosx-10.3-fat-2.4/MySQLdb
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-fat-2.4
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0)
-D__version__=1.2.2 -I/usr/local/mysql/include/mysql
-I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c
_mysql.c -o build/temp.macosx-10.3-fat-2.4/_mysql.o
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.4/_mysql.o
-L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm -o
build/lib.macosx-10.3-fat-2.4/_mysql.so
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccR04Uyn.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
=


-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql connector error

2007-08-27 Thread Pelletier Vincent
Le Samedi 25 Août 2007 17:07, Kevin a écrit :
 Intermittently, I recieve an error *Shouldn't load state for 0xf5f137
 when the connection is closed
 *

This means there is somewhere a reference to a persistent object which keeps 
it past transaction commit, which is a bad behaviour.

 I implemented this object because the standard mysql database adapter
 would fail if the connection was idle for some time with a similar kind
 of error.

I *think* the error you previously got was not the same, but a conection 
closed from regular ZMySQLDA. It is because only the query is protected 
against such error (it causes a reconnection  query retry), but not the 
BEGIN query, which is of course issued first and causes the error to go up 
uncatched. I have a ZMySQLDA version which fixes this problem (an another 
tricky one), and it should get merged into upstream version in near future.
You can grab it on:

http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/

Just one remark: a bug has been found in this version which causes problems if 
multiple connections with the same id exist in different places, due to a 
pooling mechanism used to fix the tricky bug. It will work just fine if you 
use site-scope unique ids - as it works for me - but you will get troubles if 
that's not the case.

-- 
Vincent Pelletier
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql connector error

2007-08-27 Thread Kevin
Your right, the older mysql da I was using gave 'Shouldn't Load State 
When Connection is Closed'.
It turns out that my DA is implemented correctly, but the database 
cursor is being persisted in another object(past transaction commit) as 
you noted.  So, with some readjusting, the error seems resolvable.


Thanks for the explanation!

-Kevin

Pelletier Vincent wrote:

Le Samedi 25 Août 2007 17:07, Kevin a écrit :
  

Intermittently, I recieve an error *Shouldn't load state for 0xf5f137
when the connection is closed
*



This means there is somewhere a reference to a persistent object which keeps 
it past transaction commit, which is a bad behaviour.


  

I implemented this object because the standard mysql database adapter
would fail if the connection was idle for some time with a similar kind
of error.



I *think* the error you previously got was not the same, but a conection 
closed from regular ZMySQLDA. It is because only the query is protected 
against such error (it causes a reconnection  query retry), but not the 
BEGIN query, which is of course issued first and causes the error to go up 
uncatched. I have a ZMySQLDA version which fixes this problem (an another 
tricky one), and it should get merged into upstream version in near future.

You can grab it on:

http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/

Just one remark: a bug has been found in this version which causes problems if 
multiple connections with the same id exist in different places, due to a 
pooling mechanism used to fix the tricky bug. It will work just fine if you 
use site-scope unique ids - as it works for me - but you will get troubles if 
that's not the case.


  


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySql connector error

2007-08-25 Thread Kevin
I have a mysqldb connector object based on 
http://svn.zope.org/mysqldbda/ under zope 2.9.7


Intermittently, I recieve an error *Shouldn't load state for 0xf5f137 
when the connection is closed

*
I implemented this object because the standard mysql database adapter 
would fail if the connection was idle for some time with a similar kind 
of error.


class MySQLdbAdapter(SimpleItem,ZopeDatabaseAdapter):

...
   def __call__(self):
...
return connection

there is an object stored, I call it and return the mysql cursor and use cursor 
to make queries ala the python module.

Does this look famileir to anyone else, if so, how was the error overcome?





-Kevin
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Mysql Lock Unlock with zsql

2007-05-04 Thread trashman
 

Hi, 

I must use mysql lock/unlock  with zsql. I haven't found anything about it. 
There is any solutions? I must lock a table but i don't know how do it :(

max

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql Lock Unlock with zsql

2007-05-04 Thread Andreas Jung



--On 4. Mai 2007 17:34:23 +0200 [EMAIL PROTECTED] wrote:




Hi,

I must use mysql lock/unlock  with zsql. I haven't found anything about
it.  There is any solutions? I must lock a table but i don't know how do
it :(


Since LOCK is a SQL statement you can *of course* integrate with ZSQL 
method which basically send the configured SQL statements straight down to 
the database server...where is the problem`?


-aj

pgpkMeOLY7PFs.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-DB] URL Loading Error - Zope+MySQL

2006-11-16 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 16 Nov 2006, at 06:23, oknam park wrote:


Hi All,

I'm trying to add data in mysql database using DTML in Zope.

But, all other fields are okay. But, url fiels does not call URL I  
entered. Instead it
generates the url for add dtml method like http:// 
www.thegateway.org/about/gemingeneral/gemConsortium/memberDirectory/ 
contactadd.


Could you give me some piece of advice how to handle?
Any advice would be really appreciated. Best regards, Nam


I see in your form that you call the input field URL - this is  
probably colliding with the reserved word URL that is part of the  
REQUEST object. Give the input field a different name.


jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFXCghRAx5nvEhZLIRApKBAJ9HDC1VRSTrQ6bBllSdxyJq8PqjkQCfbgvI
E2CnVQ7CgUK5Uc+AV3JPLe8=
=Dhml
-END PGP SIGNATURE-
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] URL Loading Error - Zope+MySQL

2006-11-15 Thread oknam park


Hi,

Terribly Sorry for cross posting. and not clear explanation.

Sincerely,
Nam


From: Andreas Jung [EMAIL PROTECTED]
Reply-To: Andreas Jung [EMAIL PROTECTED]
To: oknam park [EMAIL PROTECTED], zope-db@zope.org
Subject: Re: [Zope-DB] URL Loading Error - Zope+MySQL
Date: Thu, 16 Nov 2006 06:44:12 +0100

Your posting really does not contain anything related to your question.
You provide the code of a form and ask about putting the stuff into
a database. What do you want to tell us? You need to write a ZSQL method.
Everything is documented here

http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx

-aj

--On 16. November 2006 05:23:08 + oknam park [EMAIL PROTECTED] 
wrote:



Hi All,

I'm trying to add data in mysql database using DTML in Zope.

But, all other fields are okay. But, url fiels does not call URL I
entered. Instead it
generates the url for add dtml method like
http://www.thegateway.org/about/gemingeneral/gemConsortium/memberDirector
y/contactadd.

Could you give me some piece of advice how to handle?
Any advice would be really appreciated. Best regards, Nam

Here is my add dtml method:
dtml-var standard_html_header
dtml-if submit
dtml-call contactadd3
h2New Member Information Added!!/h2
p
a href=memberlist2View all Member Information/a|
a href=selectcall?SiteID:string=dtml-var SiteIDView Added
Information/a
br
a href=edit1Edit Member Information/a |
a href=deleteDelete Member Information/a |
a href=contactaddAdd Member Information/a
br

dtml-else
h1Member Information Add/h1
form action=contactadd method=POST
table width=95% cellspacing=0 
  tr
td width=20%div
align=centerstrongSiteID:/strong/div/td
td width=80%input name=SiteID width=30 value=/td
  /tr

tr
td width=20%div
align=centerstrongAgency:/strong/div/td
td width=80%input name=Agency width=30 value=/td
  /tr

tr
td width=20%div align=centerstrongURL:/strong/div/td
td width=80%input name=URL width=30 value=/td
  /tr

tr
td width=20%div align=centerstrongLast
Name:/strong/div/td
td width=80%input name=LastName width=30 value=/td
  /tr

tr
td colspan=2 align=left
input
type=submit name=submit value=Add
input type=reset name=cancel value=Cancel
/td
/tr
/table
/form/dtml-ifdtml-var standard_html_footer

Here is memberlist2 page:
dtml-var standard_html_header
h2Member Information Update/h2
ul
dtml-in selectAllMethod
li dtml-var SiteID
br

font size=-1a href=editcall?SiteID=dtml-var SiteIDEdit/a|a
href=delete?SiteID=dtml-var SiteIDdelete/a/font

p
/dtml-in
/ul

br
a href=contactaddAdd a New Member Information/a
dtml-var standard_html_footer

_
Get the latest Windows Live Messenger 8.1 Beta version.?Join now.
http://ideas.live.com

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db




--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope  Plone development, Consulting




 attach3 


_
Talk now to your Hotmail contacts with Windows Live Messenger. 
http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://get.live.com/messenger/overview


___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope] mysql socket problem, MOSX 10.4.7

2006-08-09 Thread Dieter Maurer
baiewola wrote at 2006-8-9 05:16 -0700:
 ...
We can connect with PHP apps, Filemaker Pro, and MySQL client. However,
all Z MySQL database connections are broken. Here is the error:
OperationalError: (2002, Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2))

After googling and reading this article
http://www.devshed.com/c/a/MySQL/Troubleshooting-Problems-with-MySQL-Programs/1/
I think the problem is that the socket file is supposed to be at
/tmp/mysql.sock but it's not there. How does it get there?

Usually, the server creates it on startup (when it is ready to
accept connections there).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL queries in Python

2006-08-01 Thread Muk Yan
Dear Coveted Braintrust,I was wondering if anyone had any experience with MySQL queries in Python in Zope:import MySQLdbimport stringrequest = container.REQUESTsession = request.SESSION
result = (context.aq_parent).selects.select_from_table()print resultreturn printedWHERE select.select_from_table() IS:SELECT nameFROM personWHERE ID = dtml-var REQUEST.SESSION.get
('person_id')I know the MySQL query works, but I get garbage results from the python script (Shared.DC.ZRDB.Results.Results instance at 0x132a5c88). All I want is to contain the results of the SQL query in a list or container.
Thanks and take care,Muk Yan
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Jonathan



Have a look at this:

http://www.zope.org/Members/spinwing/ZSQL_Results



Jonathan

  - Original Message - 
  From: 
  Muk Yan 
  To: zope@zope.org 
  Sent: Tuesday, August 01, 2006 2:50 
  PM
  Subject: [Zope] MySQL queries in 
  Python
  Dear Coveted Braintrust,I was wondering if anyone had 
  any experience with MySQL queries in Python in Zope:import 
  MySQLdbimport stringrequest = container.REQUESTsession = 
  request.SESSIONresult = 
  (context.aq_parent).selects.select_from_table()print resultreturn 
  printedWHERE select.select_from_table() IS:SELECT nameFROM 
  personWHERE ID = dtml-var "REQUEST.SESSION.get 
  ('person_id')"I know the MySQL query works, but I get garbage 
  results from the python script (Shared.DC.ZRDB.Results.Results instance at 
  0x132a5c88). All I want is to contain the results of the SQL query 
  in a list or container. Thanks and take care,Muk Yan
  
  

  ___Zope maillist 
  - 
  Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** 
  No cross posts or HTML encoding! **(Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announcehttp://mail.zope.org/mailman/listinfo/zope-dev 
  )
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Andreas Jung



--On 1. August 2006 14:50:19 -0400 Muk Yan [EMAIL PROTECTED] wrote:


I know the MySQL query works, but I get garbage results from the python
script (Shared.DC.ZRDB.Results.Results instance at 0x132a5c88).  All I
want is to contain the results of the SQL query in a list or container.



Zope Book 2.7 edition - RDBMS chapter. The result object is an iterator 
will return a row of the resultset for each iteration.


-aj

pgpVcDD2jTQav.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread John Barham

import MySQLdb


This is probably redundant.


import string

request = container.REQUEST
session = request.SESSION

 result = (context.aq_parent).selects.select_from_table()

print result


Assuming you want the person's name printed, change this line to:

print result[0].name

Think of the result from a ZSQL query as a list/iterator over the
resulting rows.  In your case I'm assuming there is only one person
row w/ the given id, so there is only one row in the result, but you
still have to explicitly de-reference it w/ its index.

HTH,

 John
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Dennis Allison

Usually you install the database adaptor ZMySQLDB and make queries through 
a ZSQL Method object.

On Tue, 1 Aug 2006, Muk Yan wrote:

 Dear Coveted Braintrust,
 
 I was wondering if anyone had any experience with MySQL queries in Python in
 Zope:
 
 import MySQLdb
 import string
 
 request = container.REQUEST
 session = request.SESSION
 
 result = (context.aq_parent).selects.select_from_table()
 
 print result
 return printed
 
 WHERE select.select_from_table() IS:
 
 SELECT name
 FROM person
 WHERE ID = dtml-var REQUEST.SESSION.get('person_id')
 
 I know the MySQL query works, but I get garbage results from the python
 script (Shared.DC.ZRDB.Results.Results instance at 0x132a5c88).  All I
 want is to contain the results of the SQL query in a list or container.
 
 Thanks and take care,
 Muk Yan
 

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Paul Winkler
On Tue, Aug 01, 2006 at 02:50:19PM -0400, Muk Yan wrote:
 Dear Coveted Braintrust,
 
 I was wondering if anyone had any experience with MySQL queries in Python in
 Zope:

People have already answered your main question, but:

 SELECT name
 FROM person
 WHERE ID = dtml-var REQUEST.SESSION.get('person_id')

Never ever pass raw user input to a sql query!  If you're not familiar
with the phrase sql injection...  google it :)

The zope book relational databases chapter explains how to use
dtml-sqlvar which is one way to avoid the danger.  

-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql 5.0, ZMySQLDA and stored procedures

2006-01-17 Thread Greg Fischer
Yeah, I put up a patch on the MySQLDb Sourceforge page a long time ago for that. Doing almost the same thing. Only I made it so you specify the client flag in the Zope connection object. Doesnt do any good for windows though, they still have a problem with the mysql lib. (I think I posted a bug on that too)
GregOn 1/16/06, Cameron Beattie [EMAIL PROTECTED] wrote:
I was getting the following error when attempting to call a stored procedurevia a Z SQL Method:_mysql_exceptions.OperationalError: (1312, etcSo I made the following change to/usr/lib/zope/lib/python/Products/ZMySQLDA/db.py:
def _parse_connection_string(self, connection):kwargs = {'conv': self.conv, 'client_flag': 65536 #inserted by CSB }I then restarted Zope. I can now successfully call stored procedures. There
may be a better way to do it. Feel free to advise if so.Apologies if this information has already been posted.Cameron___Zope maillist-
Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope** No cross posts or HTML encoding!**(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )-- 
Greg Fischer1st Byte Solutionshttp://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql 5.0, ZMySQLDA and stored procedures

2006-01-17 Thread Dieter Maurer
Cameron Beattie wrote at 2006-1-17 17:37 +1300:
I was getting the following error when attempting to call a stored procedure 
via a Z SQL Method:
_mysql_exceptions.OperationalError: (1312, etc

You consult your MySQL documentation to find out what the error
code 1312 means...

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySql 5.0, ZMySQLDA and stored procedures

2006-01-16 Thread Cameron Beattie
I was getting the following error when attempting to call a stored procedure 
via a Z SQL Method:

_mysql_exceptions.OperationalError: (1312, etc

So I made the following change to 
/usr/lib/zope/lib/python/Products/ZMySQLDA/db.py:

   def _parse_connection_string(self, connection):
   kwargs = {'conv': self.conv,
'client_flag': 65536 #inserted by CSB
}

I then restarted Zope. I can now successfully call stored procedures. There 
may be a better way to do it. Feel free to advise if so.


Apologies if this information has already been posted.

Cameron 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySql problems

2005-12-01 Thread Dennis Allison

I have not yet completed differential diagnosis, but I was hoping someone 
had encountered a similar problem and could pass along a fix/workaround.

The following program fails to do the writes -- 

import MySQLdb
initdb='test'
dbuser = 'root'
dbpass = 'XX'
host = 'localhost'
connection = MySQLdb.connect( db=initdb,  user=dbuser, passwd=dbpass, 
host=host )
cursor = connection.cursor()
qd = delete from test.data
cursor.execute(qd)
qi = insert into test.data values('ardvark', 'homework') 
print qi
cursor.execute( qi)
q2 = select * from test.data
cursor.execute( q2)
res = cursor.fetchall()
print res

when run with Mysql-Python-1.2.1c under Python 2.4.2, but works just
find with Mysql-Python-1.1.1 under Python 2.3.5.

The tables are Innodb tables (that is, transactional).

Running Zope with Python 2.4.2 and Mysql-Pyton 1.2.1c works just fine.

Is there something special I need to do that I have forgotten?


-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql problems

2005-12-01 Thread Tino Wildenhain
Am Donnerstag, den 01.12.2005, 15:45 -0800 schrieb Dennis Allison:
 I have not yet completed differential diagnosis, but I was hoping someone 
 had encountered a similar problem and could pass along a fix/workaround.
 
 The following program fails to do the writes -- 
 
 import MySQLdb
 initdb='test'
 dbuser = 'root'
 dbpass = 'XX'
 host = 'localhost'
 connection = MySQLdb.connect( db=initdb,  user=dbuser, passwd=dbpass, 
 host=host )
 cursor = connection.cursor()
 qd = delete from test.data
 cursor.execute(qd)
 qi = insert into test.data values('ardvark', 'homework') 
 print qi
 cursor.execute( qi)
 q2 = select * from test.data
 cursor.execute( q2)
 res = cursor.fetchall()
 print res

I see no connection.commit() there.
Zope always commits (if all successfull)
when a request is done.

 when run with Mysql-Python-1.2.1c under Python 2.4.2, but works just
 find with Mysql-Python-1.1.1 under Python 2.3.5.

This mysql-python-1.1.1 might have something like autocommit
switched on. The readme or changes.txt of both versions
should tell you that.

 The tables are Innodb tables (that is, transactional).
(more or less ;)

 Running Zope with Python 2.4.2 and Mysql-Pyton 1.2.1c works just fine.
 

Regards
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-DB] related to Plone+Zope+MySQL

2005-11-13 Thread -bhavana -
hi,
i mean to say i create one protlet and search to my MySQL database but the result is shown in non Plone page. how to i display my result in body of Plone?

please help.

thankx in advance.
bh
On 11/11/05, Andreas Jung [EMAIL PROTECTED] wrote:
--On 11. November 2005 14:27:49 +0700 -bhavana - 
[EMAIL PROTECTED]wrote: Dear all,i have connection with MySQL from Zope and Plone and i create search from Zope and Plone too. But i cant search from the portlet that is in Plone
 interface to MySQL database. Please help me out of this...thankx in advance bh i cant search from the portlet means what?-aj

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


[Zope-DB] related to Plone+Zope+MySQL

2005-11-10 Thread -bhavana -
Dear all,

i have connection with MySQL from Zope and Plone and i create search from Zope and Plone too. But i cant search from the portlet that is in Plone interface to MySQL database. Please help me out of this...

thankx in advance
bh

___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-DB] related to Plone+Zope+MySQL

2005-11-10 Thread Andreas Jung



--On 11. November 2005 14:27:49 +0700 -bhavana - [EMAIL PROTECTED] 
wrote:



Dear all,
 i have connection with MySQL from Zope and Plone and i create search from
Zope and Plone too. But i cant search from the portlet that is in Plone
interface to MySQL database. Please help me out of this...
 thankx in advance
bh



 i cant search from the portlet means what?

-aj


pgpG05BL4HA8o.pgp
Description: PGP signature
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Chris Withers

Richard Smith wrote:
A very quick test shows the basics work just fine (adding a record to a 
table and displaying the whole table).  Just watch authentication - 
they've changed the password algorithms again as in the 3/4 upgrade.  
The work around is in the manual.


rats, probably only an issue if someone's using MySQL encrypted 
passwords and SUF, and will require a patch to Zope. *sigh*


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Tino Wildenhain

Greg Fischer schrieb:
This is totally unimportant, but I was just curious to know if anyone is 
running Mysql 5 on Zope right now.


why should one? :)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-05 Thread Chris Withers

Greg Fischer wrote:

This is totally unimportant, but I was just curious to know if anyone is
running Mysql 5 on Zope right now.


That would be some achievement! ISn't MySQL written in C++ or something?

Seriously though, Andy Dustman is your man, maybe try compiling mySQLdb 
and seeing if it'll connect to MySQL 5?


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Mysql 5? Just curious.

2005-10-04 Thread Greg Fischer
This is totally unimportant, but I was just curious to know if anyone is running Mysql 5 on Zope right now.
-- Greg Fischer1st Byte Solutionshttp://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] mysql-python build error

2005-09-13 Thread Sophia Grimm
I installed Plone 2.1 from the binary installer at
plone.org and MySQL 4.1 from the binary at mysql.com.
When attempting to build MySQL-python-1.2.0 on MOSX
10.4.2 client, I get this error:

sh: line 1: mysql_config: command not found
sh: line 1: mysql_config: command not found
running build
running build_py
running build_ext
building '_mysql' extension
gcc -bundle -undefined dynamic_lookup
build/temp.darwin-8.2.0-Power_Macintosh-2.3/_mysql.o
-L/usr/local/mysql/include -lz -lmysqld -o
build/lib.darwin-8.2.0-Power_Macintosh-2.3/_mysql.so
/usr/bin/ld: can't locate file for: -lmysqld
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Obviously, it's looking for -lmysqld. I don't know
where to change setup.py (or what to change it to) so
this will work. Any tips are appreciated!!

SG



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] error: release unlocked lock with Zope/MySQL

2005-08-06 Thread Dennis Allison
[Reposted with a non-blank Subject field]

We've been seeing this problem for some time.  Earlier postings to the
list were helpful in that we have eliminated possible causes, but the
problem has never been resolved.  Any assistance in tracking down the
problem and fixing it would be greatly appreciated.

Our configuration:

Athlon dual processor machine
RH7.3 
Zope 2.7.6 with ZEO
Python 2.4.1  (same problem occurs with Python 2.3.5)
Mysql-Python 1.21.c3
ZMySQLDA 2.09b3
MySql-4.0.20

This is a fragment from the event log:

2005-06-07T16:06:42 ERROR(200) ZMySQLDA exception during _begin
Traceback (most recent call last):
  File /opt/zope/zproducts/standard/ZMySQLDA/db.py, line 349, in _begin
self.db.ping()
OperationalError: (2013, 'Lost connection to MySQL server during query')
--
2005-06-07T16:06:42 PANIC(300) ZODB A storage error occurred in the last 
phase of a two-phase commit.  This shouldn't happen. The application will 
not be allowed to commit until the site/storage is reset by a restart.
Traceback (most recent call last):
  File /usr/local/src/zope/Zope2.7/lib/python/ZODB/Transaction.py, line 
377, in _finish_many
jar.tpc_finish(self)
  File /usr/local/src/zope/Zope2.7/lib/python/Shared/DC/ZRDB/TM.py, line 
59, in tpc_finish
try: self._finish()
  File /opt/zope/zproducts/standard/ZMySQLDA/db.py, line 376, in _finish
self._tlock.release()
error: release unlocked lock
--
2005-06-07T16:06:42 ERROR(200) ZODB A storage error occured during object 
abort. This shouldn't happen.
Traceback (most recent call last):
  File /usr/local/src/zope/Zope2.7/lib/python/ZODB/Transaction.py, line 
412, in _commit_error
j.tpc_abort(self) # This should never fail
  File /usr/local/src/zope/Zope2.7/lib/python/Shared/DC/ZRDB/TM.py, line 
63, in abort
try: self._abort()
  File /opt/zope/zproducts/standard/ZMySQLDA/db.py, line 389, in _abort
self._tlock.release()
error: release unlocked lock
--
2005-06-07T16:06:42 ERROR(200) SiteError 
http://dev.agilemind.com/logged_in
Traceback (most recent call last):
  File /usr/local/src/zope/Zope2.7/lib/python/ZPublisher/Publish.py, 
line 107, in publish
transactions_manager.commit()
  File /usr/local/src/zope/Zope2.7/l[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.--
2005-08-06T20:47:21 ERROR(200) ZMySQLDA exception during _begin
Traceback (most recent call last):
  File /opt/zope/zproducts/standard/ZMySQLDA/db.py, line 349, in _begin
self.db.ping()
OperationalError: (2013, 'Lost connection to MySQL server during query')
--

We get the release unlocked lock message occasionally, frequently but
not always preceded by the connection lost message.  

Our my.cnf file for MySQL is

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-innodb
set-variable=max_connections=2048
set-variable=long_query_time=1
#log-bin=/var/log/mysql/epaul-bin
#log-bin-index=/var/log/mysql/epaul-bin.index
#log-slow-queries=/var/log/mysql/epaul-slow.log
# change timeouts to close rather than wait
# interactive == 1 hour, programs == 5 mins
set-variable=interactive_timeout=3600
set-variable=wait_timeout=300
# uncomment to not log connection problems
#set-variable=log-warnings=off

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


We use MyISAM tables and the MySQL autocommit mode rather than handling 
locks and transactions explicitly.

From a user perspective, refreshing the Zope page recovers from the error 
and allows one to continue working.



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-06 Thread Hugo Ramos
Yellow Andy,

In fact what you've said works!
That line was missing on db.py and after I inserted it there
everything works the right way.

I guess this thread is now over. Thanks!!!


Cheers
Hugo



On 6/3/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote:
  Yellow,
 
  I wrote the wrong version.
  I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3
 
 Take a look at ZMySQLDA/db.py:
 
 http://cvs.sourceforge.net/viewcvs.py/mysql-python/ZMySQLDA/lib/python/Products/ZMySQLDA/db.py?rev=1.21view=auto
 
 You may need to add a line like this to the DB class:
 
 conv[FIELD_TYPE.TIMESTAMP] = _mysql_timestamp_converter
 
 Not sure why this is missing.
 
 --
 Computer interfaces should never be made of meat.
 http://www.terrybisson.com/meat.html
 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Chris Withers

Hugo Ramos wrote:

Could anyone explain me why this works in Zope 2.7.0 final and doesn't
work in Zope 2.7.6 final and/or 2.8.0b1 ??


If Zope is really hanging, look at DeadlockDebugger and find out where 
it's hanging...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Hugo Ramos
I already know what exactly makes Zope hang!
The problem is located at times.py that was installed by MySQL-Python
1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)

==OLD==
def mysql_timestamp_converter(s):
Convert a MySQL TIMESTAMP to a Timestamp object.
s = s + 0*(14-len(s)) # padding
parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
   s[8:10],s[10:12],s[12:14])))
try: return apply(Timestamp, tuple(parts))
except: return None
==OLD==

HACKED
import DateTime

def mysql_timestamp_converter(s):
Convert a MySQL TIMESTAMP to a Timestamp object.
s = s + 0*(14-len(s)) # padding
parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
   s[8:10],s[10:12],s[12:14])))
try: return apply(DateTime.DateTime, tuple(parts))
except: return None
HACKED

Oren Goldschmidt helped me here and we just made a very nasty hack...
As you can see we imported DateTime and replaced the Timestamp inside
the try statement.

This makes Zope behave!!! But it's a nasty hack that could break other
stuff around there.

Comments???


Cheers
Hugo



On 6/3/05, Chris Withers [EMAIL PROTECTED] wrote:
 Hugo Ramos wrote:
  Could anyone explain me why this works in Zope 2.7.0 final and doesn't
  work in Zope 2.7.6 final and/or 2.8.0b1 ??
 
 If Zope is really hanging, look at DeadlockDebugger and find out where
 it's hanging...
 
 Chris
 
 --
 Simplistix - Content Management, Zope  Python Consulting
 - http://www.simplistix.co.uk
 
 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Andy Dustman
On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote:
 I already know what exactly makes Zope hang!
 The problem is located at times.py that was installed by MySQL-Python
 1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)

This is a package for Python-2.4. Are you using Python-2.4 with
Zope-2.7? If you are, the line of people prepared to yell at you is
long and distinquished.

What version of ZMySQLDA are you using? Only 2.0.9b3 will work
properly with MySQLdb-1.2.0.
-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Hugo Ramos
Yellow,

I wrote the wrong version.
I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3

This is the DTML code generating the error:
dtml-var docdataemissao fmt=%Y-%m-%d

docdataemissao is a timestamp field in a table like:
200406011023

The traceback:
Error Type: ValueError
Error Value: unsupported format character 'Y' (0x59) at index 1

[...]
Module DocumentTemplate.DT_String, line 474, in __call__ 
Module DocumentTemplate.DT_In, line 703, in renderwob 
Module DocumentTemplate.DT_Var, line 280, in render
__traceback_info__: ('docdataemissao', DateTime object for
'2005-06-01 12:34:45.00' at 19878e0, {'': 'docdataemissao', 'fmt':
'%Y-%m-%d'})

Any ideas???


Cheers
Hugo



On 6/3/05, Andy Dustman [EMAIL PROTECTED] wrote:
 On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote:
  I already know what exactly makes Zope hang!
  The problem is located at times.py that was installed by MySQL-Python
  1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)
 
 This is a package for Python-2.4. Are you using Python-2.4 with
 Zope-2.7? If you are, the line of people prepared to yell at you is
 long and distinquished.
 
 What version of ZMySQLDA are you using? Only 2.0.9b3 will work
 properly with MySQLdb-1.2.0.
 --
 Computer interfaces should never be made of meat.
 http://www.terrybisson.com/meat.html
 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Andy Dustman
On 6/3/05, Hugo Ramos [EMAIL PROTECTED] wrote:
 Yellow,
 
 I wrote the wrong version.
 I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3

Take a look at ZMySQLDA/db.py:

http://cvs.sourceforge.net/viewcvs.py/mysql-python/ZMySQLDA/lib/python/Products/ZMySQLDA/db.py?rev=1.21view=auto

You may need to add a line like this to the DB class:

conv[FIELD_TYPE.TIMESTAMP] = _mysql_timestamp_converter

Not sure why this is missing.

-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] MySQL timestamp issue

2005-06-02 Thread Hugo Ramos
Yellow,

Could anyone explain me why this works in Zope 2.7.0 final and doesn't
work in Zope 2.7.6 final and/or 2.8.0b1 ??

dtml-var timestampvar fmt=%Y-%m-%d

also when I try this:

dtml-var _.DateTime(timestampvar) fmt=%Y-%m-%d

Zope hangs!!!

ps: timestampvar is a timestamp var comming from MySQL 4.0.24


tia
-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MYSQL Problem

2001-01-29 Thread Andy Dustman

On Sun, 28 Jan 2001, Jens Grewen wrote:

 I installed 
 
 mySQL-3.23.32
 mySQLdb 0.3.1
 ZmySQLDA 2.0.4
 
 When I change to mediumint (database field description) I get the
 expected 233.
 
 How can I fix this.

You just did. :) If a mediumint is big enough for you, use that. As Ron
points out, INTEGER (particularly UNSIGNED) can overflow in Python, so
they need to be returned as Python long integers. Python adds the L when
doing str(), but Python 2.0+ does not do this (only on repr()).

-- 
Andy Dustman PGP: 0xC72F3F1D
@   .net http://dustman.net/andy
"Normally with carbonara you use eggs, but I used lobster brains instead."
-- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MYSQL Problem

2001-01-27 Thread Jens Grewen



I installed 

mySQL-3.23.32
mySQLdb 0.3.1
ZmySQLDA 2.0.4

on Win98


From the following SQL statmentI get the 
result 233L and not 233 as expected

select count(PID)from product

When I run this SQL Statment from another program I 
get the expected value 233.


In my installation there are a lot of Z SQL Methods 
that should return an int value and when I use field description int in the 
databaseI always get this 'L' behind the expected result. A lot of things 
don´t work because of this.

When I change to mediumint (database field 
description)I get the expected 233.

How can I fix this.


Thanks

Jens


[Zope] MySQL

2001-01-26 Thread Piotr Kozbial

I have upgraded to MySQL 3.23.28 and both ZMySQLDA and ZMySQLTDA were
broken.Thus I have installed latest
ZMySQLDA-2.0.4 and MySQLdb 0.3.1.

Ufter upgrade it does not work.

I am able to search pages, ie.:
http://arete.ibb.waw.pl/html/leksykon/cd_rom_report_en?nazwa_angielska=b
but I am unable to display single records, ie.:
http://arete.ibb.waw.pl/html/leksykon/single_record_report_hasla2?nazwa_ident_hasla2=933

  Traceback (innermost last):
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /opt/www/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /opt/www/zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: NowehaslaReplyForm)
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: NowehaslaReplyForm)
  File /opt/www/zope/lib/python/OFS/DTMLDocument.py, line 189, in
__call__
(Object: NowehaslaReplyForm)
  File /opt/www/zope/lib/python/DocumentTemplate/DT_String.py, line 538,
in __call__
(Object: NowehaslaReplyForm)
  File /opt/www/zope/lib/python/DocumentTemplate/DT_In.py, line 711, in
renderwob
(Object: single_id_hasla2)
  KeyError: (see above)

I am unable to use TIMESTAMP from database
ie.:
Traceback (innermost last):
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /opt/www/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /opt/www/zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: search_report_pl)
  File /opt/www/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: search_report_pl)
  File /opt/www/zope/lib/python/OFS/DTMLMethod.py, line 189, in __call__
(Object: search_report_pl)
  File /opt/www/zope/lib/python/DocumentTemplate/DT_String.py, line 538,
in __call__
(Object: search_report_pl)
  File /opt/www/zope/lib/python/DocumentTemplate/DT_In.py, line 480, in
renderwb
(Object: simple_search_pl)
  File /opt/www/zope/lib/python/Shared/DC/ZRDB/DA.py, line 488, in
__call__
(Object: simple_search_pl)
  File /opt/www/zope/lib/python/Shared/DC/ZRDB/DA.py, line 435, in
_cached_result
(Object: simple_search_pl)
  File /opt/www/zope/lib/python/Products/ZMySQLDA/db.py, line 231, in
query
  File /opt/www/zope/lib/python/Products/ZMySQLDA/db.py, line 104, in
_mysql_timestamp_converter
ValueError: (see above)


What is wrong. Is is MySQL or ZOPE or ZMySQLDA problem?

Regards,
Piotr
-- 
_
Piotr Kozbial http://arete.ibb.waw.pl

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2001-01-26 Thread Andy Dustman

On Fri, 26 Jan 2001, Piotr Kozbial wrote:

 I have upgraded to MySQL 3.23.28 and both ZMySQLDA and ZMySQLTDA were
 broken.Thus I have installed latest
 ZMySQLDA-2.0.4 and MySQLdb 0.3.1.

MySQL-3.23.32 would be a good idea. It has at least one security fix, and
a lot of bug fixes. 
 
 Ufter upgrade it does not work.
   File /opt/www/zope/lib/python/DocumentTemplate/DT_In.py, line 711, in
 renderwob
 (Object: single_id_hasla2)
   KeyError: (see above)

I have no idea for that one.
 
 I am unable to use TIMESTAMP from database
 ie.:
   File /opt/www/zope/lib/python/Products/ZMySQLDA/db.py, line 104, in
 _mysql_timestamp_converter
 ValueError: (see above)

Can you find out what the value is that it doesn't like?
 
 What is wrong. Is is MySQL or ZOPE or ZMySQLDA problem?

Possibly ZMySQLDA. I would need to see specifically what the error message
is that comes with the ValueError exception. 

-- 
Andy Dustman PGP: 0xC72F3F1D
@   .net http://dustman.net/andy
"Normally with carbonara you use eggs, but I used lobster brains instead."
-- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL connection string.

2001-01-21 Thread Joachim Werner

Indra Gunawan wrote:

 Hello,
 could anyone tell me how to make connection string to MySQL in Linux?
 I use Zope 2.3 and I've tried the 
 
 database@[host] username password

This should work. Your problem is probably somewhere else. Are you sure 
that the database adapter, database etc. are all set up correctly?

Joachim.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL connection string.

2001-01-20 Thread Indra Gunawan

Hello,
could anyone tell me how to make connection string to MySQL in Linux?
I use Zope 2.3 and I've tried the 

database@[host] username password

format, and still no luck,
TIA,

-IGUN-


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] mysql connection string

2001-01-15 Thread Olaf Zanger

hi there,

two times trouble

first:
right now my setup uses a connection string "db root" which doesn't seam
to give a lot of savety :-). 
at my provider i have a login, but sure no root access to the db. 
* how does the connection string look for user name "peter-hauser" and
password "test3-.2"?
* has the user to be set up in "linux" ?
* how is the setup made in "mysql"?
i tried with "grant all privileges on *.* to "peter-hauser"@localhost;"
and "set password for "peter-hauser"=password('test3-.2');"
but wasn't successful.
* has zope to be run by user "peter-hauser"?

second?
to set up a 3-tier application i should know how to connect mysql
through MySQL-python 0.3.0 and ZMySQLDA 2.0.1 to my db-server.

* i can browse from the zope server to the db-server "pit" and otherway
round with the names "pit" and "pitechon", so "hosts" file should be
correct. 

* how has the connection string to look like?
i tried "db@pit 'peter-hauser'" but it didn't work?
* has mysql to be started with an special flag to open a port?
* does it work with the ip-number?

thanks for help 
olaf


-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Marc Zanger
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
http://www.soli-con.com

begin:vcard 
n:Zanger;Olaf Marc
tel;cell:+41-76-572 9782
tel;work:+41-31-332 9782
x-mozilla-html:FALSE
url:www.soli-con.com
org:soli-con Engineering Zanger
adr:;;Lorrainestrasse 23;Bern;BE;3013;Switzerland
version:2.1
email;internet:[EMAIL PROTECTED]
title:Dipl.-Ing.
note;quoted-printable:IT-Consulting=0D=0AEmbedded Systems=0D=0AEnergy Systems=0D=0AOpen Source Solutions=0D=0A
x-mozilla-cpt:;-32176
fn:Olaf Zanger
end:vcard



Re: [Zope] mysql connection string

2001-01-15 Thread Oleg Broytmann

On Mon, 15 Jan 2001, Olaf Zanger wrote:
 right now my setup uses a connection string "db root" which doesn't seam
 to give a lot of savety :-).
 at my provider i have a login, but sure no root access to the db.
 * how does the connection string look for user name "peter-hauser" and
 password "test3-.2"?

   [EMAIL PROTECTED] peter-hauser test3-.2 --\
|
 * has the user to be set up in "linux" ?  |
|
   No, only in mysql.   |
|
 * how is the setup made in "mysql"?   |
|
   GRANT select,insert,update,delete,create,alter,drop,index|
ON db.* TO [EMAIL PROTECTED] INDENTIFIED BY 'test3-.2';|
|
 * has zope to be run by user "peter-hauser"?  |
|
   No, you pass peter-hauser in the connection string -/

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL

2001-01-11 Thread Eric Walstad

http://www.zope.org/Members/alanpog/zmysqlda_steps
Should get you started...
Eric.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of vishnu
prasad
Sent: Tuesday, January 09, 2001 3:17 PM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL


can anyone update me with list of activities that I need to follow for
having MySQL installed and integrated with Zope?

thanks in advance,
vp


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2001-01-11 Thread Petter Enholm


Hi,

I did not get mySQL running using the HOW-TO below. It seems to be outdated,
as there is not need for patching anymore. The following HOW-TO is newer;
http://www.zope.org/Members/MikeP/ZMySQLDA. I had mySQL up and running in no
time when following this HOW-TO.

If you are using mySQL on WIN32 use the following HOW-TO:
http://www.zope.org/Members/philh/mysql, and download all the files this
HOW-TO refers to, instead of compiling your own (if you don't know exactly
what you are doing).

I don't want to sound negative, but someone should really tidy up these
HOW-TOs for mySQL and remove the old ones. What caused me most trouble when
installing mySQL for the first time was to find the correct HOW-TO.

Q: Are there any person responsible for the HOW-TO's?

Suggestion: Now that there are many persons working with Zope, writing
HOW-TO's etc - would it be an idea to create categories for the different
HOW-TO's and that each category should have a maintainer, responsible for
removing old HOW-TO's or at least clearly state which version of the
products they are valid for? I could take responsibility for one category
... I think this could improve the quality of the available
documentation.

Best regards
Petter Enholm

Also:
- Original Message -
From: "Eric Walstad" [EMAIL PROTECTED]
To: "vishnu prasad" 
Cc: "[EMAIL PROTECTED]" [EMAIL PROTECTED]
Sent: Wednesday, January 10, 2001 12:32 AM
Subject: RE: [Zope] MySQL


 http://www.zope.org/Members/alanpog/zmysqlda_steps
 Should get you started...
 Eric.
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of vishnu
 prasad
 Sent: Tuesday, January 09, 2001 3:17 PM
 To: [EMAIL PROTECTED]
 Subject: [Zope] MySQL


 can anyone update me with list of activities that I need to follow for
 having MySQL installed and integrated with Zope?

 thanks in advance,
 vp


 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL connection woes

2001-01-09 Thread paul_s_johnson

After following several howtos, tracking numerous threads from this list,
and spending several days losing my mind, I sense that I am finally getting
closer to having Zope and MySQL talking to each other.

SETUP:
I am running on Linux with Redhat with MySQL 3.22.32 and ZMySQLDA with
ZMySQL-python.  The later two are installed such that ZMySQLDA is NOT
broken. I installed using the RPMs supplied by Ron Bickers available on his
FTP site (thanks, Ron) and followed additional instructions supplied on
earlier threads.

PROBLEM:
My problem now is I can't find a connection string that works. I understand
the connection syntax and tried every possibility. My suspicion is that I
am having a permissions problem with MySQL. I found this former list email:

 My suggestion would be to set up mysql to accept a null login (no
 username, no password), create a database in there called "test" and
 connect with the connection string "test@localhost"

thank u, this was the point to my problem. I have tried a nologin mysql
and it
worked with database@myhost !!! :)
so i know i have a grant table problem in mysql (no big deal - i hope :) )

QUESTION:
Being a relative newbie to this whole thing (Linux, Zope, MySQL, etc.), how
do I create a null login in MySQL with blanket privleges? Could it still be
a faulty ZMySQLDA setup? How do I troubleshoot that possibility?

Thanks,

P. Johnson


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL connection woes

2001-01-09 Thread paul_s_johnson

   
   
   
   
"Randall F.  To: [EMAIL PROTECTED]  
   
Kern"cc:   
   
randy@spoke.Subject: RE: [Zope] MySQL connection woes 
   
net   
   
   
   
01/09/01   
   
12:08 PM   
   
   
   
   
   







For a quick test, run the mysql client from the command line.

Let's say your connection string was:
  foodb paul passwd

Start mysql like this:
$ mysql -u paul -p foodb

And when prompted for the password, enter passwd.

This will ensure mysql is setup correctly.  Make sure you do this from
the same machine that is running Zope, as MySql can be configured for
different access from different machines.

If you want to play with "null" passwords and such, look at the
mysql.user and mysql.db tables.  Remember to run "mysqladmin
flush-privileges" after making changes to the user and db tables.

This last part I did not know, thanks!

Ok, I am getting closer. I finally found a connection string that Zope
accepts, but now when I test the connection with a query like "SHOW
TABLES;" or a SELECT query it I get the message:

 "There was no data matching this Z MySQL Database Connection
(connected) query."

- even though I know these tables exist. The connection says that it is
open and it will only accept connection strings of databases that really
exist in MySQL.

INFO:
MySQL user name: root
hostname: www.myhost.com
password: none

Zope Connection string: [EMAIL PROTECTED] root

In the grant tables there is the following entries:
In user: [EMAIL PROTECTED] with no privileges
In db: [EMAIL PROTECTED] with all privileges for mydatabase.* except for
Grant_priv

One other parameter that may have a bearing: the box's name is
station99.ispname.net even though it hosts www.myhost.com (or is it the
other way around?).

Any suggestions why the connection is not working properly?






___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL connection woes

2001-01-09 Thread paul_s_johnson




One other bizarre symptom: when I test the database connection with a
INSERT query it works and inserts data into the designated MySQL table in
the query, although there is no indication that it is working in Zope. I
changed the user table for the MySQL user cited in the connection string so
that all privileges are on and still no luck.

P. Johnson

For a quick test, run the mysql client from the command line.

Let's say your connection string was:
  foodb paul passwd

Start mysql like this:
$ mysql -u paul -p foodb

And when prompted for the password, enter passwd.

This will ensure mysql is setup correctly.  Make sure you do this from
the same machine that is running Zope, as MySql can be configured for
different access from different machines.

If you want to play with "null" passwords and such, look at the
mysql.user and mysql.db tables.  Remember to run "mysqladmin
flush-privileges" after making changes to the user and db tables.

This last part I did not know, thanks!

Ok, I am getting closer. I finally found a connection string that Zope
accepts, but now when I test the connection with a query like "SHOW
TABLES;" or a SELECT query it I get the message:

 "There was no data matching this Z MySQL Database Connection
(connected) query."

- even though I know these tables exist. The connection says that it is
open and it will only accept connection strings of databases that really
exist in MySQL.

INFO:
MySQL user name: root
hostname: www.myhost.com
password: none

Zope Connection string: [EMAIL PROTECTED] root

In the grant tables there is the following entries:
In user: [EMAIL PROTECTED] with no privileges
In db: [EMAIL PROTECTED] with all privileges for mydatabase.* except for
Grant_priv

One other parameter that may have a bearing: the box's name is
station99.ispname.net even though it hosts www.myhost.com (or is it the
other way around?).

Any suggestions why the connection is not working properly?






___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL

2001-01-09 Thread vishnu prasad



can anyone update me with list of activities that I need to 
follow for having MySQL installed and integrated with Zope?

thanks in advance,
vp


[Zope] mySQL DA on Win32

2000-12-14 Thread Lee Reilly CS1997

Hi,

Zope is currently being installed on the Unix machines at my uni but it
won't be available for a while. However, I have set up a mySQL database
in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
only access the database from uni so I must have a database adpater
setup on this machine.

I have seen the mySQL DA on Zope.org but I understand that it "does not
support win32 platforms at this time". I need database access ASAP so
can anyone offer any advice?

Thanks very much,

Lee

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Phil Harris

Lee,

Have you read the MySQL on Win32 howto?

btw,  give my regards to Duncan. 

Phil
[EMAIL PROTECTED]

- Original Message - 
From: "Lee Reilly CS1997" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 14, 2000 2:46 PM
Subject: [Zope] mySQL DA on Win32


 Hi,
 
 Zope is currently being installed on the Unix machines at my uni but it
 won't be available for a while. However, I have set up a mySQL database
 in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
 only access the database from uni so I must have a database adpater
 setup on this machine.
 
 I have seen the mySQL DA on Zope.org but I understand that it "does not
 support win32 platforms at this time". I need database access ASAP so
 can anyone offer any advice?
 
 Thanks very much,
 
 Lee
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Petter Enholm

 From: "Lee Reilly CS1997" [EMAIL PROTECTED]

 I have seen the mySQL DA on Zope.org but I understand that it "does not
 support win32 platforms at this time". I need database access ASAP so
 can anyone offer any advice?

There is a HOW-TO for this:  How-To: ZMySQLDA on Win32

Search for it on www.zope.org. I run Zope and mySQL (3.23.28-gamma) on
Win95. Advice; download the files as specified in the how-to. I tried to use
the .dll file that we're installed with mySQL  - crashed Python/Zope. Also,
remember to store Python files in correct Python directory if you have
installed more than one version / installation of Python.

Best regards
Petter Enholm
Snapper


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Jim Washington

Hi, Lee

I got zope and mysql working together last night on win2k.  I used the
instructions in

http://www.zope.org/Members/philh/mysql

(Thanks, Phil Harris!)

I did have to use the custom dll and pyd mentioned there.

http://www.google.com/search?q=mysql+zope+win32 might have more clues if
this does not meet your needs.  

To answer your next question, 
the connection string is like 'db@host username password'

hth,

-- Jim Washington

Lee Reilly CS1997 wrote:
 
 Hi,
 
 Zope is currently being installed on the Unix machines at my uni but it
 won't be available for a while. However, I have set up a mySQL database
 in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
 only access the database from uni so I must have a database adpater
 setup on this machine.
 
 I have seen the mySQL DA on Zope.org but I understand that it "does not
 support win32 platforms at this time". I need database access ASAP so
 can anyone offer any advice?
 
 Thanks very much,
 
 Lee

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] mySQL DA on Win32

2000-12-14 Thread sean . upton

Couldn't one just use MyODBC and the ODBC DA?  What disadvantages (besides
latency from yet another API to go through) are there to this approach?

Sean

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Lloyd Kvam

I came across links that recommended recompiling both MySQL and the MySQL DA.  I
did so without too much difficuly.  The batch compile scripts did not work, but
compiling through the MicroSoft IDE did work.  The source code I pulled down
required the Microsoft compiler, not gcc++.

I still have the download files.  I could also send you the results of my
compilations.  I do not remember the URL's I used to get these files, but it was
probably through the mysql web site.

Lee Reilly CS1997 wrote:

 Hi,

 Zope is currently being installed on the Unix machines at my uni but it
 won't be available for a while. However, I have set up a mySQL database
 in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
 only access the database from uni so I must have a database adpater
 setup on this machine.

 I have seen the mySQL DA on Zope.org but I understand that it "does not
 support win32 platforms at this time". I need database access ASAP so
 can anyone offer any advice?

 Thanks very much,

 Lee

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )

--
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 603-443-6155
fax: 801-459-9582



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL

2000-11-30 Thread K H Subrahmanyan

hi,
   I want to add MySQL to my ZOPE.

Please help me in installing it.

Please give the links, necessary information.

thanks
bye
subrahmayan.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2000-11-30 Thread Chris Withers

K H Subrahmanyan wrote:
 
 hi,
I want to add MySQL to my ZOPE.
 
 Please help me in installing it.
 
 Please give the links, necessary information.

How about actually doing some work for yourself for a change rather than
expecting everyone else to do it for you?

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] mysql zope

2000-11-30 Thread Alexander DePauli

Hi Zopistas!

we are looking for a method to do a better integration of mysql
3.23.27 with zope 2.2.2. (we are using the Z MySQL database adapter Z
MySQL DA 1.1.3.)

We have to store data in a mysql database - we can´t use ZODB 
because we need the data accessible by other programs via ODBC.

We habe implemented several ZClasses like "customer", "product" and
"orders". 
We store their instances (eg. each product, customer and so on) to the
mysql-database.  

Our problem: we can´t use the standard ZOPE management interface to
manage the
objects, because the methods of this interface store content to the ZODB
-
and not to the mysql-database. 

Is there a way to extend the standard ZOPE management interface with
additional mysql statements?
For example: we select an object in a zope folder, press the ZOPE
Delete-Button, then this
object is deleted on the mysql-database, not on the ZODB?

For each zclass (customer, products, orders) we need these extra methods
(Delete, Update, Insert ...), so our thought is that we would prefer to
use the ZOPE management interface to do this instead of programming
"extra methods" which obviously can't be used within the standard ZOPE
management interface.

Hope there is somebody out there with an similarly problem solved.

best regards

Ruediger
~
http://www.herrenausstatter.de - Der Online-Herrenausstatter
Kostenlose Serviceline: 0800 -999 66 33
Versandkostenfreie Lieferung - 30 Tage Rückgaberecht
~
Verwaltungsadresse:
DePauli.com Aktiengesellschaft
Stahlgruberring 3 - 81829 München
Telefon: 089 / 530 75 170 - Telefax 089 / 514 50 666

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mysql zope

2000-11-30 Thread Steve Spicklemire


Hi  Ruediger,

You might consider ZPatterns. It allows you to develop
applications with ZODB, and then, later, 'easily' switch to
other forms of attribute storage for your objects.

-steve

 "Alexander" == Alexander DePauli [EMAIL PROTECTED] writes:

Alexander Hi Zopistas!

Alexander we are looking for a method to do a better integration
Alexander of mysql 3.23.27 with zope 2.2.2. (we are using the Z
Alexander MySQL database adapter Z MySQL DA 1.1.3.)

Alexander We have to store data in a mysql database - we can´t
Alexander use ZODB because we need the data accessible by other
Alexander programs via ODBC.

Alexander We habe implemented several ZClasses like "customer",
Alexander "product" and "orders".  We store their instances
Alexander (eg. each product, customer and so on) to the
Alexander mysql-database.

Alexander Our problem: we can´t use the standard ZOPE management
Alexander interface to manage the objects, because the methods of
Alexander this interface store content to the ZODB - and not to
Alexander the mysql-database.

Alexander Is there a way to extend the standard ZOPE management
Alexander interface with additional mysql statements?  For
Alexander example: we select an object in a zope folder, press
Alexander the ZOPE Delete-Button, then this object is deleted on
Alexander the mysql-database, not on the ZODB?

Alexander For each zclass (customer, products, orders) we need
Alexander these extra methods (Delete, Update, Insert ...), so
Alexander our thought is that we would prefer to use the ZOPE
Alexander management interface to do this instead of programming
Alexander "extra methods" which obviously can't be used within
Alexander the standard ZOPE management interface.

Alexander Hope there is somebody out there with an similarly
Alexander problem solved.

Alexander best regards

Alexander Ruediger ~
Alexander http://www.herrenausstatter.de - Der
Alexander Online-Herrenausstatter Kostenlose Serviceline: 0800
Alexander -999 66 33 Versandkostenfreie Lieferung - 30 Tage
Alexander Rückgaberecht ~
Alexander Verwaltungsadresse: DePauli.com Aktiengesellschaft
Alexander Stahlgruberring 3 - 81829 München Telefon: 089 / 530 75
Alexander 170 - Telefax 089 / 514 50 666

Alexander ___ Zope
Alexander maillist - [EMAIL PROTECTED]
Alexander http://lists.zope.org/mailman/listinfo/zope ** No cross
Alexander posts or HTML encoding!  ** (Related lists -
Alexander http://lists.zope.org/mailman/listinfo/zope-announce
Alexander http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL Connection String

2000-11-17 Thread Aitor Grajal Crespo



I have installed ZMySQLDA 1.1.4, 
anybody knows the format of the database connection string???

I have put database user passw , and doesn't work

Thanks



Re: [Zope] MySQL Connection String

2000-11-17 Thread Tony McDonald

On 17/11/00 4:36 pm, "Aitor Grajal Crespo" [EMAIL PROTECTED]
wrote:

 I have installed ZMySQLDA 1.1.4,
 anybody knows the format of the database connection string???
 
 I have put database user passw , and doesn't work
 
 Thanks
 
 

database@host user passwd

'host' can be 'localhost' for database servers on the same machine as
Zope...
hth
Tone
--
Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 222 5116
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Connection String

2000-11-17 Thread Eric Walstad

I use the following format:

users@frankenstein privileged_user ThePassWord
- or in general terms -
TableName[@HostNameOfMachineMySQLIsRunningOn] MySQLUserName ThePassWord

I guess the "@HostNameOfMachineMySQLIsRunningOn" part is optional, but I
needed to put it in there for my setup.
The "privileged_user" is one that you've done a MySQL GRANT for. I.e.
something like:
GRANT SELECT,INSERT,UPDATE ON DatabaseName.TableName TO MySQLUserName
IDENTIFIED BY 'ThePassWord';

FYI, I found this info in ALANPOG's HowTo:
http://www.zope.org/Members/alanpog/zmysqlda_steps

hth, Eric.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Aitor
Grajal Crespo
Sent: Friday, November 17, 2000 8:37 AM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL Connection String


  I have installed ZMySQLDA 1.1.4,
anybody knows the format of the database connection string???

I have put database user passw , and doesn't work

Thanks


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL and Zope struggles

2000-10-18 Thread Richard Moon

Thanks Monty,

I did try the temporary table route - problem is that Zope keeps the 
connection open so the temporary table stays there. Of course you can 
explicitly drop the temporary table after you've used it. However if the 
update fails for any reason the temporary table will still exist so next 
time in the SQL method fails because its trying to create a temporary table 
that is already there. I know this shouldn't happen etc but I don't like 
code that has that kind of potential problem in it - it isn't 'fail-safe'.

I decided better to use a permanent table. The SQL method locks it, deletes 
everything in it then writes the data it needs to store. That way its fail 
safe and I would expect more efficient than creating and dropping tables.

However I hadn't appreciate the REPLACE command. That's a real hidden gem. 
I'm off to see if I can use it - thanks.

Richard

At 11:37 17/10/00, you wrote:
You can do it with temporary tables.

Like this-

create temporary table foo (
   note_id int,
   notes varchar
);
insert into foo select Note.note_id, Note.notes from Note, Artist
   where Note.note_id=Artist.note_id and Artist.artist_id=23;
update foo set notes="asdlfna";
replace into Note select note_id, notes from foo;

This does assume that the note_id is unique.
You may also need to explicitly drop foo, because it goes away when you
disconnect, but of course  Zope holds connections open.

!!! However -- now that I think of it... you can just do:
replace into Note select note_id, "New Note" from Artist where artist_id=23;

Of couse, this will change all notes for an artist, so it assumes the
artist_id is unique as well. (Which I would assume it is from your model.)

If you need more complex things, look into temporary tables, but the MySQL
extension (like replace) do allow you to do fun things.

Hope this helps,
Monty

Richard Moon wrote:

  Nice idea. Trouble is the note table is used to hold notes for many
  different reasons, so it looks like this -
 
---   
  | Artist| | Recording  |  | Label  |   etc.
---   
  | artist_id | |recording_id|  |label_id|
  | note_id   | |note_id |  |note_id |
---   
|   ||  |   |
 -
  |
  --
 | Note |
  --
 | note_id  |
 | notes|
  --
 
  It looks as if there wasn't anything I was missing - I'm just going to have
  to break the code up into separate SQL Methods.
 
  The example I gave was quite simple compared to some of the updates I have
  to deal with.
 
  Thanks anyway.
 
  At 17:40 16/10/00, you wrote:
  Or you could renormalize your data to have:
  
- ---
  |  Artist |   |  Note |
  |-|---|---|
  |  id |   | id|
-| artist_id |
 | note_str  |
  ---
  
  you now have a list of notes by artist_id.
  You typically won't have a screen that doesn't have an Artist context
  to be adding a note to. (or to remove all notes from).
  Of course this means more work to migrate :-(
  And I don't know all possible scenarios for which you would
  need the structure you gave, but it is another way around this.
  It probably doesn't solve real complex scenarios either.
  
  JAT
  
  Dale
 
  Richard Moon
  [EMAIL PROTECTED]
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  http://lists.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://lists.zope.org/mailman/listinfo/zope-announce
   http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL and Zope struggles

2000-10-18 Thread Baker, Dennis [sjmr]

What about one sql method:

select @noteid:=note_id from artist where dtml-sqltest artist_id type=int
dtml-var sql_delimiter 
update note set notes =dtml-sqlvar notes type=string
 where note_id = @noteid



-Original Message-
From: Richard Moon [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 2:48 AM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL and Zope struggles


I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL 
(Why ? - because I've got a kind offer of free hosting if I use MySQL).

MySQL offers a limited set of features and is missing, among other things, 
the ability to use subqueries - so for example in PostgreSQL you can say

update note set notes =dtml-sqlvar notes type=string
 where note_id =
 (select note_id from artist where dtml-sqltest artist_id type=int)

and in MySQL you can't.

If you were working in a traditional programming environment you could 
overcome this by splitting the above into two parts - a select to retrieve 
the value of note_id from the artist table followed by an update of the 
note table using the returned value of note-id.

For example

select note-id into note-id-var from artist where artist-id = 23;
update note set notes = 'asdasda' where note-id = note-id-var;

The problem is that in Zope I believe you can't use a returned value within 
an SQL Method,  so the above code would fail. The only way I can see to do 
the above is to have two separate SQL Methods, one for the select, 
returning the note-id-var and another for the update. This is very clumsy.

I was wondering if anyone could tell me if there was a better way.

Many thanks


Richard

Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL and Zope struggles

2000-10-17 Thread Monty Taylor

You can do it with temporary tables.

Like this-

create temporary table foo (
  note_id int,
  notes varchar
);
insert into foo select Note.note_id, Note.notes from Note, Artist
  where Note.note_id=Artist.note_id and Artist.artist_id=23;
update foo set notes="asdlfna";
replace into Note select note_id, notes from foo;

This does assume that the note_id is unique.
You may also need to explicitly drop foo, because it goes away when you
disconnect, but of course  Zope holds connections open.

!!! However -- now that I think of it... you can just do:
replace into Note select note_id, "New Note" from Artist where artist_id=23;

Of couse, this will change all notes for an artist, so it assumes the
artist_id is unique as well. (Which I would assume it is from your model.)

If you need more complex things, look into temporary tables, but the MySQL
extension (like replace) do allow you to do fun things.

Hope this helps,
Monty

Richard Moon wrote:

 Nice idea. Trouble is the note table is used to hold notes for many
 different reasons, so it looks like this -

   ---   
 | Artist| | Recording  |  | Label  |   etc.
   ---   
 | artist_id | |recording_id|  |label_id|
 | note_id   | |note_id |  |note_id |
   ---   
   |   ||  |   |
-
 |
 --
| Note |
 --
| note_id  |
| notes|
 --

 It looks as if there wasn't anything I was missing - I'm just going to have
 to break the code up into separate SQL Methods.

 The example I gave was quite simple compared to some of the updates I have
 to deal with.

 Thanks anyway.

 At 17:40 16/10/00, you wrote:
 Or you could renormalize your data to have:
 
   - ---
 |  Artist |   |  Note |
 |-|---|---|
 |  id |   | id|
   -| artist_id |
| note_str  |
 ---
 
 you now have a list of notes by artist_id.
 You typically won't have a screen that doesn't have an Artist context
 to be adding a note to. (or to remove all notes from).
 Of course this means more work to migrate :-(
 And I don't know all possible scenarios for which you would
 need the structure you gave, but it is another way around this.
 It probably doesn't solve real complex scenarios either.
 
 JAT
 
 Dale

 Richard Moon
 [EMAIL PROTECTED]

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL and Zope struggles

2000-10-16 Thread Richard Moon

I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL 
(Why ? - because I've got a kind offer of free hosting if I use MySQL).

MySQL offers a limited set of features and is missing, among other things, 
the ability to use subqueries - so for example in PostgreSQL you can say

update note set notes =dtml-sqlvar notes type=string
 where note_id =
 (select note_id from artist where dtml-sqltest artist_id type=int)

and in MySQL you can't.

If you were working in a traditional programming environment you could 
overcome this by splitting the above into two parts - a select to retrieve 
the value of note_id from the artist table followed by an update of the 
note table using the returned value of note-id.

For example

select note-id into note-id-var from artist where artist-id = 23;
update note set notes = 'asdasda' where note-id = note-id-var;

The problem is that in Zope I believe you can't use a returned value within 
an SQL Method,  so the above code would fail. The only way I can see to do 
the above is to have two separate SQL Methods, one for the select, 
returning the note-id-var and another for the update. This is very clumsy.

I was wondering if anyone could tell me if there was a better way.

Many thanks


Richard

Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL and Zope struggles

2000-10-16 Thread administrator

I don't know if the following link can solve your problem,
but maybe it gives you an idea:
http://www.zope.org/Members/Roug/new_record_with_subrecords
(How-To: Creating a new record with subrecords in MySQL)
 Arno


 I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL
 (Why ? - because I've got a kind offer of free hosting if I use MySQL).

 MySQL offers a limited set of features and is missing, among other things,
 the ability to use subqueries - so for example in PostgreSQL you can say

 update note set notes =dtml-sqlvar notes type=string
  where note_id =
  (select note_id from artist where dtml-sqltest artist_id type=int)

 and in MySQL you can't.

 If you were working in a traditional programming environment you could
 overcome this by splitting the above into two parts - a select to retrieve
 the value of note_id from the artist table followed by an update of the
 note table using the returned value of note-id.

 For example

 select note-id into note-id-var from artist where artist-id = 23;
 update note set notes = 'asdasda' where note-id = note-id-var;

 The problem is that in Zope I believe you can't use a returned value within
 an SQL Method,  so the above code would fail. The only way I can see to do
 the above is to have two separate SQL Methods, one for the select,
 returning the note-id-var and another for the update. This is very clumsy.

 I was wondering if anyone could tell me if there was a better way.

 Many thanks


 Richard

 Richard Moon
 [EMAIL PROTECTED]



 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


 To: [EMAIL PROTECTED]



RE: [Zope] MySQL and Zope struggles

2000-10-16 Thread dale . w . lance

Or you could renormalize your data to have:

 - ---
|  Artist |   |  Note |
|-|---|---|
|  id |   | id|
 -| artist_id |
  | note_str  |
   ---

you now have a list of notes by artist_id.
You typically won't have a screen that doesn't have an Artist context
to be adding a note to. (or to remove all notes from).
Of course this means more work to migrate :-(
And I don't know all possible scenarios for which you would
need the structure you gave, but it is another way around this.
It probably doesn't solve real complex scenarios either.

JAT

Dale

-Original Message-
From: administrator [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 6:11 AM
To: zope
Cc: administrator
Subject: Re: [Zope] MySQL and Zope struggles


I don't know if the following link can solve your problem,
but maybe it gives you an idea:
http://www.zope.org/Members/Roug/new_record_with_subrecords
(How-To: Creating a new record with subrecords in MySQL)
 Arno


 I'm struggling to migrate an application from Zope/PostgreSQL to Zope 
MySQL
 (Why ? - because I've got a kind offer of free hosting if I use 
MySQL).

 MySQL offers a limited set of features and is missing, among other 
things,
 the ability to use subqueries - so for example in PostgreSQL you can 
say

 update note set notes =dtml-sqlvar notes type=string
  where note_id =
  (select note_id from artist where dtml-sqltest artist_id 
type=int)

 and in MySQL you can't.

 If you were working in a traditional programming environment you could
 overcome this by splitting the above into two parts - a select to 
retrieve
 the value of note_id from the artist table followed by an update of 
the
 note table using the returned value of note-id.

 For example

 select note-id into note-id-var from artist where artist-id = 23;
 update note set notes = 'asdasda' where note-id = note-id-var;

 The problem is that in Zope I believe you can't use a returned value 
within
 an SQL Method,  so the above code would fail. The only way I can see 
to do
 the above is to have two separate SQL Methods, one for the select,
 returning the note-id-var and another for the update. This is very 
clumsy.

 I was wondering if anyone could tell me if there was a better way.

 Many thanks


 Richard

 Richard Moon
 [EMAIL PROTECTED]



 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


 To: [EMAIL PROTECTED]



[Zope] Zope MySQL on Win98

2000-08-10 Thread William BC Crandall

Hello Zope and MySQL users,

I'm trying to access MySQL through Zope.
I hope someone can point out my set-up error(s).

Environment: 
Windows98: 4.10.98
MySQL Server:  3.23.21-beta-debug
Zope v.:   2.2.0 (binary release, python 1.5.2, win32-x86) 
Python v.: 1.5.2 (#0, Jul 30 1999, 09:52:18) [MSC 32 bit (Intel)] 
ZMySQLDA v.:   1.1.4 (nonbinary)  
   (in: zope-dir/lib/Products/ZMySQLDA/)
MySQL.pyd  'MySQLmodule-1.4: A Python interface to the MySQL
database.' 
   (this from MySQL.__doc__)
   (in: zope-dir/bin/lib/)

MySQL works fine through the mysqlc monitor and Python scripts 
using odi and odbc. But I keep crashing Zope/Python with even 
the simplest queries.

Here's what I do, followed by the mysqld -log file entries.

Start MySQL:   C:\mysql\bin\mysqld.exe --console --log
Start Zope:C:\Program Files\zope-dir\start.bat 
   (Which is, out-of-the-box:
"C:\Program Files\TotipotentZope\bin\python.exe" 
"C:\Program Files\TotipotentZope\z2.py" -D 
%1 %2 %3 %4 %5 %6 %7 %8 %9)

Zope says:
2000-08-10T11:44:08 PROBLEM(100) ZServer Computing default
hostname
--
2000-08-10T11:44:08 INFO(0) ZServer Medusa (V1.16.4.2) 
  started at Thu Aug 10 13:44:08 2000
Hostname: LAP_WILL
Port:8080
(Other than PROBLEM(100), all looks fine.)

Start Netscape   (Communicator 4.7 -- but same results with IE5)
Go to:http://localhost:8080/manage;login
Go to:folder with  'Z MySQL Database Connection'
Open: Database Connection object 'The database connection
is open.'
Go to:'Properties' click 'Change'   (without changing
anything) 
Crash:'PYTHON caused an invalid page fault in
  module MYSQL.PYD at 015f:012d3827.'


MySQL log files (tmm is a DB on MySQL):

C:\mysql\bin\mysqld.exe, Version: 3.23.21-beta-debug-log, started
with:
Tcp port: 3306  Unix socket: MySQL
Time Id CommandArgument
000810 13:56:23   1 Connectroot@localhost on 
  1 Init DBtmm
000810 13:56:35   2 Connectroot@localhost on 
  2 Init DBtmm
  1 Quit  


Many thanks for any suggestions.


William BC Crandall
Wiesbaden,  Germany
[EMAIL PROTECTED]

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL - Z SQL - dtml-var

2000-07-17 Thread Dieter Maurer

Gijs Reulen writes:
  INSERT INTO test1
  ( id, content, phone )
  VALUES (
  dtml-var 12.12,
  dtml-sqlvar content type=nb,
  dtml-sqlvar phone type=nb optional
  )
  
  According to the doc I should be able to use dtml-var statements in Z SQL
  Methods. However, this returns an error: Error, exceptions.KeyError: 12.12
This is indeed a strange variable name (12.12).

Do you mean the floating point value 12.12 rather than a variable of
this name?

In this case, you should use:
  dtml-var "12.12"

  I also tried:
  INSERT INTO test1
  ( id, content, phone )
  VALUES (
  dtml-sqlvar id type=float,
  dtml-sqlvar content type=nb,
  dtml-sqlvar phone type=nb optional
  )
  
  This also retuns an error: Error, exceptions.ValueError: Invalid
  floating-point value for id
Obviously, "id" does not contain a floating point value.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL LIKE operator

2000-07-12 Thread Aaron Williamson

Hello,

I'm writing a search query to a MySQL database.  I want to keep
people from screwing around with my database by running searches like ";
delete from ... yada yada.  So I should use dtml-sqlvar, right?  But
what if I want to use LIKE?
  If I say:  WHERE goo LIKE "%dtml-sqlvar name=bar type=string%"  then
effectively I am saying: WHERE goo LIKE "%'somestring'%".  In other
words, it will match only the string with the single quotes.  I hope
this makes sense.  Has anyone faced a similar problem?
  Thanks for any help

--Aaron


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL LIKE operator

2000-07-12 Thread Ron Bickers

You should be able to use something like this (untested):

dtml-var bar sql_quote

That way you get the SQL quoting without the surrounding quotes.

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 12, 2000 11:03 AM
 To: [EMAIL PROTECTED]
 Subject: [Zope] MySQL LIKE operator
 
 
 Hello,
 
 I'm writing a search query to a MySQL database.  I want to keep
 people from screwing around with my database by running searches like ";
 delete from ... yada yada.  So I should use dtml-sqlvar, right?  But
 what if I want to use LIKE?
   If I say:  WHERE goo LIKE "%dtml-sqlvar name=bar type=string%"  then
 effectively I am saying: WHERE goo LIKE "%'somestring'%".  In other
 words, it will match only the string with the single quotes.  I hope
 this makes sense.  Has anyone faced a similar problem?
   Thanks for any help
 
 --Aaron
 
 
 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )
 
 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-04 Thread Monty Taylor



 Original Message 

On 7/4/00, 12:47:07 AM, Andy Dustman [EMAIL PROTECTED] wrote regarding 
Re: [Zope] MySQL transaction support (was: MySQL Select Statements):

 Note also: With non-transactional databases, you would expect to get
 better performance by having several open connections which are not
 shared. In the case of MySQL, each connection has it's own server thread,
 and this can exploit CPUs, if available. However, connections should not
 be shared on transactional databases, because transactions are tied to a
 connection, and not a cursor. Even if there is a mutex to keep multiple
 threads from executing queries simultaneously on the same connection, the
 transactions are going to be whacky.

Oracle is obviously transactional. Does anyone know how it handles 
connection pooling? I'll look and see it I can figure it out, but I'd 
love it if someone already knew...

Monty

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Andy Dustman

On Mon, 3 Jul 2000, Monty Taylor wrote:

 Why not have one ZmySQLDA that attempts to determine whether it is 
 transactional or not when the connect method is executed. That way you 
 could have a DA connect to your 3.22 database, upgrade your database to 
 3.23.15 and not see any problems. A combination of try-except:ing an 
 attempted "begin rollback" block and a test for database type should do 
 the trick, no? If it's 3.22 or earlier, the begin-rollback should throw 
 the synax error Andy mentioned. If that's ok, a test for database type 
 (not sure about this one) to see if it's BDB? If all of this is wrapped 
 in the connect method, we should be able to make it 'do the right thing' 

There are two factors which determine whether or not transactions can be
supported. Actually, there's only one, but it can't be directly tested
for:

1) If the server version (easily obtained upon establishing the
connection) is  3.23.15, transactions are definitely not supported.

2) If the database in use employs BDB tables, transactions are definitely
supported.

The problem is: Support for the transaction manager is done with a MixIN
class, so the decision on whether or not transactions should be supported
in the DA comes before the connection object is created. Which raises an
interesting possibility: On the connection object's Properties tab, add a
checkbox which indicates that transactional semantics are required. The
status of this checkbox determines which class is used for the database
connection. This might be workable, not really sure.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Hannu Krosing

Andy Dustman wrote:
 
 There are two factors which determine whether or not transactions can be
 supported. Actually, there's only one, but it can't be directly tested
 for:
 
 1) If the server version (easily obtained upon establishing the
 connection) is  3.23.15, transactions are definitely not supported.
 
 2) If the database in use employs BDB tables, transactions are definitely
 supported.

AFAIK the transaction support is enabled on table-by-table basis, so
there 
is no way to know for sure if transactions are 
supported/partially-supported/unsupported for a particular set of
queries

 The problem is: Support for the transaction manager is done with a MixIN
 class, so the decision on whether or not transactions should be supported
 in the DA comes before the connection object is created. 

But after the connection is established you could probably change the
mixin 
class, at least if it is really a proxy wrapper of some other class.

Python is _very_ dynamic language.


Hannu

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Andy Dustman

On Tue, 4 Jul 2000, Hannu Krosing wrote:

 AFAIK the transaction support is enabled on table-by-table basis, so
 there 
 is no way to know for sure if transactions are 
 supported/partially-supported/unsupported for a particular set of
 queries

True enough. There are several problems here:

1) We must avoid using BEGIN/COMMIT/ROLLBACK on servers  3.23.15 because
it will result in syntax errors.

2) We must raise exceptions whenever the DA attempts to use transacation
semantics and the database cannot fulfill this. Silently allowing the
transaction manager to believe ROLLBACK has succeeded when it is actually
doing nothing is a bad thing.

3) Even though the server may support transactions, the tables may not.
Calling ROLLBACK hopefully produces an error, which is a good thing.

4) Calling ROLLBACK in AUTOCOMMIT mode probably does not produce an error.
This is bad, but easily avoided by using BEGIN to force a transaction.
Does this cause MySQL to produce an error if the tables don't support it?
I don't know. Probably not.

IMHO, the only good way to avoid these problems is to effectively have two
DAs: A transactional one and a non-transactional one, perhaps determined
by a Zope property. The application designer will have to choose which DA
to use for a given application.

Note also: With non-transactional databases, you would expect to get
better performance by having several open connections which are not
shared. In the case of MySQL, each connection has it's own server thread,
and this can exploit CPUs, if available. However, connections should not
be shared on transactional databases, because transactions are tied to a
connection, and not a cursor. Even if there is a mutex to keep multiple
threads from executing queries simultaneously on the same connection, the
transactions are going to be whacky.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Andy Dustman

I should point out that 0.2.2 has not been fully released yet. There's a
bug I have to iron out of it first. Probably next week. Also, for general
MySQLdb questions, send them to [EMAIL PROTECTED] (mailing list). Or
subscribe, it's low-volume and won't fatten your mailbox.

On Fri, 30 Jun 2000, Michael Blewett wrote:

 It's funny that you say 0.2.2 is broken. Apart from this one glitch, it 
 works fine for me (although from memory I think we had to do a little bit 
 of fiddling at install time to get it to work).

It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
..._as_dict() variants. This was just too much code duplication to put up
with, and the new interface is fetch([n[,how]]) where n is the maximum
number of rows to fetch (default 1), and how is how to return the result
(0: as tuple, 1: as dictionary, other codes may be added at some point).
To fix ZMySQLDA, change fetch_all_rows() to fetch(maxrows) in the query
routine. One other place (to get the tables) uses fetch_all_rows(). If you
insist on using 0.2.2 at this point, change that as well. 0.2.2 is marked
Alpha for a reason... And when I release it, I'll include a very small
patch to make things right with ZMySQLDA again (I'm treating mordred's as
the official one at this point).
 
 At 00:12 30/06/2000 -0400, Ron Bickers wrote:
 Why do you say you "must" use the AS statement?  Do you get an error
 otherwise?
 
 MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
 me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
 that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
 Since that one now uses his MySQLdb, he will likely kill off his own DA.

Quite true. Now for the AS statement: If you are joining tables with
identically-named columns in common, you should use AS in your SQL to
rename them. Otherwise it will return two columns with the same name to
Zope, which is bad. You do not, however, need to do this:

   Just need someone to put me straight here. When I use Select
   statements in
   an SQL Method I cannot simply :
  
   Select Column1, Column2 etc
   from TableA.
  
   Instead I must use the AS statement ie
  
   Select Column1 AS Column1, Column2 AS Column2
   from TableA.
  
 - Michael

This is just gratuitious renaming to the original name, which is not
renaming at all. Here's an example of what I'm talking about.

SELECT TableA.Col, TableB.Col from TableA, TableB # bad
SELECT TableA.Col AS ColA, TableB.Col AS ColB from TableA, TableB # good

Note that the first SELECT returned two columns named Col, which will
confuse Zope, and the second returns ColA (TableA.Col) and ColB
(TableB.Col).

Additional compatibility note: One of the 0.2.2 changes has been to
synchronize with MySQL-3.23 evolution (now at 3.23.19-beta, and GPL'd),
and the big feature here is: Transactions! Yes, as of 3.23.15,
transactions are in MySQL, if you use BDB tables. And yes, BDB does mean
Berkeley DB, specificially the Sleepycat DB v3, which supports
transactions (but probably not columns, which I presume MySQL is imposing
on the database).

For ZMySQLDA developers out there; MySQL-3.23 defaults to autocommit.
However, there is a BEGIN SQL statement which starts a transaction and
similarly for COMMIT and ROLLBACK statements. But remember: All this
transactional stuff ONLY works on BDB tables. If you try to BEGIN a
transaction (or turn off autocommit) on another table type, well, I'm not
sure what happens. Maybe you get an error, and maybe you don't. Not sure
what the solution is for this. It may be necessary to have the ZMySQLDA
package include another DA: ZMySQLTDA for transactions. The standard DA
would not be based on TM, and the transactional one could simply subclass
the other one:

# ZMySQLTDA/db.py
from Shared.DC.ZRDB.TM import TM

class DB(ZMySQLDA.DB, TM):

def _begin(self, *ignored): self.db.query("BEGIN")
def _finish(self, *ignored): self.db.query("COMMIT")
def _abort(self, *ignored): self.db.query("ROLLBACK")

Obviously the application designer will have to use the right DA for the
right table type...

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Ron Bickers

 -Original Message-
 From: Andy Dustman [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 30, 2000 11:42 AM
 To: Michael Blewett
 Cc: Ron Bickers; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [Zope] MySQL Select Statements


 It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
 ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
 implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
 ..._as_dict() variants.

Thanks for clarifying that.  I hope the 1.2.0 DA continues to follow your
(Andy's) changes to the MySQLdb so that we can have a nice, working, stable
db/DA combination.

 what the solution is for this. It may be necessary to have the ZMySQLDA
 package include another DA: ZMySQLTDA for transactions. The standard DA

Please not two DAs just for the difference in transaction support.

 Obviously the application designer will have to use the right DA for the
 right table type...

It should be as simple as the application designer actually knowing what
they're doing by knowing whether or not they're working with a table that
supports transactions or not, and just not using BEGIN/COMMIT/ROLLBACK when
they're not.  Or is it too much to ask that designers know what they're
doing? :-)

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-06-30 Thread Ron Bickers

 -Original Message-
 From: Andy Dustman [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 30, 2000 1:25 PM
 To: Ron Bickers
 Cc: Michael Blewett; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [Zope] MySQL Select Statements

 That's the problem: They don't get control over when BEGIN/COMMIT/ROLLBACK
 are used. Zope does that if you are using the Transaction Manager. And the
 only way to control use of the Transaction Manager is by
 selection of DA.

 That's why I think it may be necessary to have two ZMySQLDAs: One which is
 transactional and one which is not. However, they can both be part of the
 same distribution, and the transactional one can simply subclass the
 non-transactional one (mixing in the TM base and adding the required
 methods), so there is not a lot of code duplication.

I see.  So how would this affect use of transaction and non-transaction
supporting tables?  Would two separate database connections be required
where the SQLMethod must use the correct connection depending on transaction
support?

Making assumptions is bad, but suppose MySQL 3.23 does something elegant
with BEGIN/COMMIT/ROLLBACK attempts on non-transaction supporting tables
(like return a "table does not support transactions" or simply ignores that
statement).  Could we then just have one DA for 3.22 and another for 3.23,
where the 3.23 DA handles transactions, but silently ignores them when
dealing with non-transaction tables?

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-06-30 Thread Dieter Maurer

Michael Blewett writes:
  Select Column1, Column2 etc
  from TableA.
  
  Instead I must use the AS statement ie
  
  Select Column1 AS Column1, Column2 AS Column2
  from TableA.
Zope should not be responsible for this strange behaviour.

It simply executes the SQL statement and asks the result
for the result column names. It then wraps each result
row in an object that allows to access a column value
as attribute under the respective column name.

You could try:
dtml-let SQLresult=SQLMethod
  dtml-var "SQLresult.names()"
/dtml-in
to get the list of column names your Z SQL Method
"SQLMethod" returns.

This may give you a hint how your database names result columns.


I recently found out that Oracle returns column names
converted into all uppercase. I needed about 2 hours
to analyse this weird behaviour.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] MySQL Select Statements

2000-06-29 Thread Michael Blewett

Hi Everyone,
Just need someone to put me straight here. When I use Select statements in 
an SQL Method I cannot simply :

Select Column1, Column2 etc
from TableA.

Instead I must use the AS statement ie

Select Column1 AS Column1, Column2 AS Column2
from TableA.

Is this just an oddity with the MySQLDA/Db adapters or am I overlooking 
something blatantly obvious here? All the examples on zope.org don't have 
the extra "AS Column1" additions on them and I was wondering if this is a 
Zope/mySQL-unique thing.

I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database 
Adapter (ZMySQLDA) 2.0.0a1 and
MySQLdb module release: 0.2.2 .

Could someone please let me know as I don't want to have to type the extra 
bits on all my SQL statements from here on in if I don't need to (I am the 
world's worst and laziest typist). If it is the case that it's a necessary 
evil, then I want to put a HowTo or Tip up on zope.org because it took me a 
while to figure out what I was doing wrong, and if I can save someone else 
that same wasted time then I would like to. However I wanted to get my 
facts straight (via all you experts) first.

Thanks for any help...

  - Michael
~~~
Michael Blewett
Computer Support Mgr - Biological Sciences
Monash University (Clayton Campus)
Victoria Australia 3168

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-06-29 Thread Curtis Maloney

On Fri, 30 Jun 2000, Michael Blewett wrote:
 Hi Everyone,
 Just need someone to put me straight here. When I use Select statements in
 an SQL Method I cannot simply :

 Select Column1, Column2 etc
 from TableA.

Depending on  the column names, yes you can.  I just tested it not, and it 
works fine.  If the column names are not valid zope/python names, you will 
run into problems.

 Instead I must use the AS statement ie

 Select Column1 AS Column1, Column2 AS Column2
 from TableA.

 Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
 something blatantly obvious here? All the examples on zope.org don't have
 the extra "AS Column1" additions on them and I was wondering if this is a
 Zope/mySQL-unique thing.

Can you try to construct the simplest example of a query that doesn't work?


 I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
 Adapter (ZMySQLDA) 2.0.0a1 and
 MySQLdb module release: 0.2.2 .

Hmm.. I am using the same, except for ZMySQLda 1.1.3, and MySQLdb 0.1.2.  So, 
perhaps it's new in ZMySQLda 2.0.


 Could someone please let me know as I don't want to have to type the extra
 bits on all my SQL statements from here on in if I don't need to (I am the
 world's worst and laziest typist). If it is the case that it's a necessary

What, you've never heard of cut'n'paste? (o8

 evil, then I want to put a HowTo or Tip up on zope.org because it took me a
 while to figure out what I was doing wrong, and if I can save someone else
 that same wasted time then I would like to. However I wanted to get my
 facts straight (via all you experts) first.

A wise move, and a wonderful gesture.


 Thanks for any help...

   - Michael

Have a better one,
Curtis Maloney

dtml-var standard_work_disclaimer

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




  1   2   >