Page 1 of 1

MySQL and CGI ; wrong engine ?

Posted: Tue Jul 10, 2007 11:06 am
by Eric_Taquet
revOpenDatabase fails to work when used inside my CGI rev script !

I've a little text file CGI that try to open a MySQL database, retrive data that is then HTML formated and sent back.

This script works fine with the same database params when run from Revolution.app with GUI

If I remove (comment) all database statements, this script also runs fine as a CGI !

the /private/var/log/httpd/error_log reports a fail on "revOpenDatabase"

I've installed the engine mentioned in the tutorial by Jacqueline Landman Gay : http://www.runrev.com/downloads/engines ... gi/osx.zip
I run an Apache 1.3.33 server on a Mac 10.4.10 with MySQL 5

Is this engine the good engine ? Does it allow database access ? Is there any other one ? How to get other engines ? Is there a special trick ?

Thank you very much !

Eric, FRANCE

Posted: Tue Jul 10, 2007 11:16 am
by Eric_Taquet
in fact, the http://www.runrev.com/downloads/engines ... gi/osx.zip

is a 2.5 engine !!!

I know that with a simple statement in my CGI :

put "Runtime Revolution version :" && the version after buffer

Posted: Tue Jul 10, 2007 12:00 pm
by Janschenkel
Hi Eric,

The difference in version number is historic: originally, Revolution wasd an alternative IDE for the MetaCard engine. The engine and IDe versions didn't match until Revolution 2.7 came out.
In this case, Revolution 2.1.2 was built on top of MetaCard 2.5, and the 'version' global property returns the engine version, which was 2.5 at the time.

Back to your original question.

I could be wrong, but I think the version you're looking for is at:
ftp://ftp.runrev.com/pub/revolution/dow ... darwin.sit
At any rate, you may find another post interesting:
http://forums.runrev.com/phpBB2/viewtopic.php?t=119

Also, to connect to MySQL 4 or 5, you will have to enable 'old-style' passwords.
http://www.sonsothunder.com/devres/revo ... ata004.htm

Hope this helped,

Jan Schenkel.

Posted: Wed Jul 11, 2007 11:45 am
by Eric_Taquet
thank you very much Jan !

with your help, I've made a step :

1

I've intalled in : /Library/WebServer/CGI-Executables
the files : revolution & dbmysql.so
coming from package : ftp.runrev.com/pub/revolution/downloads/engines/2.0/cgi/darwin.sit

2

this engine requests the lib : /usr/local/lib/libdl.1.dylib
but it doesn't exist on MacOSX 10.4.10
the equivalant (IMHO) is the generic : /usr/lib/libdl.dylib
that links itself to : /usr/lib/libSystem.B.dylib

I've created a link "libdl.1.dylib" to "libdl.dylib"
with Terminal :

cd /usr/local/lib
sudo ln -s /usr/lib/libdl.dylib libdl.1.dylib

Now, my CGI can access to a MySQL connection, but I get the error :

"Client does not support authentication protocol requested by server; consider upgrading MySQL client"

I'm going to try to setup an old style connect ...

thx again !
Eric, France

Posted: Wed Jul 11, 2007 11:57 am
by Janschenkel
I think you can switch to 'old style' passwords from the MySQL Administrator, without running the query mentioned in Ken Ray's tip. As I don't have access to my desktop computer right now, I can't give you the exact location of the option, but I'll look later today.

Jan Schenkel.

Posted: Wed Jul 11, 2007 12:16 pm
by Eric_Taquet
With Navicat (my administration client for MySQL), I've tried :

SET PASSWORD FOR 'robot'@'localhost' = OLD_PASSWORD('xxxx');

and now "robot" can connect and work with the database, from within the CGI !!!!!!!!!

yaouuuuuuuuuuuuuuuu !!!!!!!

thx a lot Jan !!! :D :D :D

Eric :D

Posted: Wed Jul 11, 2007 5:40 pm
by Janschenkel
Heh, then the next bit of advice comes a tad too late ;-)
If you have downloaded the MySQL Administrator app, you open that, go to the 'Options' tab, use the menu button to switch to the 'Security' panel, and then tick the checkbox 'Use old passwords'.

Enjoy your new-found powers of Rev cgi and MySQL !

Jan Schenkel.

Posted: Wed Jul 11, 2007 11:45 pm
by Eric_Taquet
thanks again, Jan, for your help !

I've read in your footer : Quartam Reports & PDF Library for Revolution

I may be interested in PDF Lib for Rev !

I used to format data extracted from my SQL database as HTML, with templates, but it could be useful to produce some PDF documents also !

Where can I find information about your product ?

Thank you

Eric

Posted: Thu Jul 12, 2007 5:04 am
by Janschenkel
Bonjour Eric,

The website for all Quartam products is located (perhaps a bit uninspired) at http://www.quartam.com
You can click the link right here, or you can use the link at the end of my signature, or you can click the 'www' button at the bottom of each reply.
Isn't it wonderful how the web gives us so many options, just like Revolution? :-)

Best regards,

Jan Schenkel.

Posted: Thu Jul 12, 2007 12:52 pm
by Eric_Taquet
thank you Jan

I'm near blind and I've not seen those links the first time !