[Zope] Zope is not getting MySQL SELECT results ...
Dave Woolston
davew@digicool.com
Wed, 24 Jan 2001 14:47:35 -0500
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