RE: [Zope] Zope is not getting MySQL SELECT results ...
Hello Gerald,
Hello Gerald,
Hi all.
I have set up, in a clean Zope installation, a MySQL database adapter. My connection string is "test test test", indicating a user test with
password
test connection to the test database.
The adapter indicates that it can connect to the database, and I can send queries to the database. CREATE TABLE, INSERT, UPDATE, and other queries work just fine through the "test" tab of the adapter management interface, but it does not seem to be able return any data through a SELECT query. This does not work in the "test" table nor in a SQL method. Using a query, such as "select * from test", it always replies with:
-------------------------------------------- There was no data matching this My Query query.
SQL used: select * from test --------------------------------------------
This may seem like a silly response, but have you tried the same select statement from outside zope - say from the mysql client? perhaps your select statement is truly returning an empty set. We use zope with PostgreSQL and MySQL (and have been for a few years) and haven't had any problems.
This is some good advice - Also, just based on your example - you could be connected to your database (test) correctly, but you need to have a table called test for the query to work - you didn't really state if you had a table called test. Below - I have a database called test that I can connect to - but no tables called test: mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | bigstuff | | groups | | shop | | t_chunks | | t_largeobj | | user_group_map | | users | +----------------+ 7 rows in set (0.00 sec) mysql> select * from test; ERROR 1146: Table 'test.test' doesn't exist As you can see - you would get the result you described if you did not have a table defined. HTH ================================= Dave Woolston davew@digicool.com Digital Creations www.digicool.com (716) 262-4715
This may seem like a silly response, but have you tried the same select statement from outside zope - say from the mysql client? perhaps your select statement is truly returning an empty set. We use zope with PostgreSQL and MySQL (and have been for a few years) and haven't had any problems.
This is some good advice - Also, just based on your example - you could be connected to your database (test) correctly, but you need to have a table called test for the query to work - you didn't really state if you had a table called test.
Hi Dave. Yes it is. In my original message I had indicated that I tried executing my queries in the mysql client, as well as through the API of MySQL-python; both worked just fine. As it turns out, I had downloaded an "old" copy of ZMySQLDA. There are a number of pages that each imply that they link the latest version of this product. The link from www.zope.org itself (http://www.zope.org/Products/external_access) has two entries for this product! I downloaded 1.2.0, but apparently 2.0.1 is available, which works with Zope 2.3.0. Paul Johnson was the kind soul who provided me with the link to the "correct" version of ZMySQLDA (http://www.zope.org/Members/adustman/ZMySQLDA). Gerald.
participants (2)
-
Dave Woolston -
Gerald Gutierrez