MySQL and CGI ; wrong engine ?

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

MySQL and CGI ; wrong engine ?

Post by Eric_Taquet » Tue Jul 10, 2007 11:06 am

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
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Post by Eric_Taquet » Tue Jul 10, 2007 11:16 am

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
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Tue Jul 10, 2007 12:00 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Post by Eric_Taquet » Wed Jul 11, 2007 11:45 am

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
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Wed Jul 11, 2007 11:57 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Post by Eric_Taquet » Wed Jul 11, 2007 12:16 pm

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
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Wed Jul 11, 2007 5:40 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Post by Eric_Taquet » Wed Jul 11, 2007 11:45 pm

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
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Thu Jul 12, 2007 5:04 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Eric_Taquet
Posts: 29
Joined: Wed Feb 14, 2007 3:26 pm
Location: FRANCE, Villeneuve d'Ascq

Post by Eric_Taquet » Thu Jul 12, 2007 12:52 pm

thank you Jan

I'm near blind and I've not seen those links the first time !
The Erikoded Frenchy
La logique est le dernier refuge des gens sans imagination
Oscar Wilde :: Logic is the last refuge of the unimaginative

Post Reply

Return to “CGIs and the Server”