revOpendataBase on Linux

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
riccardo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 13
Joined: Sat Apr 15, 2006 10:03 am
Location: Italia

revOpendataBase on Linux

Post by riccardo » Sat Apr 15, 2006 10:26 am

When I try to connect to MySQL on a Linux machine, I have this result:
revdberr.invalid database type.

Where can be the problem?
MySQL runs correctly and I can connect it with 'mysql query browser' application.

WIth rev I can't.
Is a drive problem?If yes, where have I get and install the MySQL driver?
Thanks in advance

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

Re: revOpenDatabase on Linux

Post by Janschenkel » Sat Apr 15, 2006 3:19 pm

Hi Riccardo,

The good news is that it does work on Linux - though setting things up can be tricky, especially to make the engine find the database drivers.
While this should work fine within the Rev IDE, it is still a good thing to check.

From an old post by Mark Waddingham on the use-rev list:
Mark Waddingham wrote:The Revolution 2.5 (and up) Linux engine has both revXML and revDB embedded within it, so the externals are not necessary. However, the database drivers themselves are not embedded and you need to tell the engine where to find them by doing:

Code: Select all

revdb_setdriverpath <path_to_drivers> 
  or 
revSetDatabaseDriverPath <path_to_drivers>
Where <path_to_drivers> is the directory containing the drivers. Also, Linux paths are case-sensitive so make sure that the value you pass for the database type looks the same as the driver file:
- if you pass "mysql" the engine will look for dbmysql.so
- if you pass "MySQL" the engine will look for dbMySQL.so
Also, when you're using MySQL, the next problem youy encounter may be 'old-style' passwords. Until the Revolution database driver is updated to accomodate the new style passwords, you will have to change the settings in MySQL Administrator.

Hope this helped,

Jan Schenkel
Quartam Reports & PDF Library for LiveCode
www.quartam.com

riccardo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 13
Joined: Sat Apr 15, 2006 10:03 am
Location: Italia

Post by riccardo » Sat Apr 15, 2006 3:59 pm

Hi Jan
Thanks for your reply.

I had tried this command:
revSetDatabaseDriverPath "/home/amministratore/Desktop/Revolution-2.6.1/components/global environment/database_drivers/Linux/"
but the revOpenDatabase ("mysql","localhost","test","root",""") returns always the same result: revdberr, invalid database type.

Have you any other suggestions?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Post by BvG » Sat Apr 15, 2006 5:41 pm

riccardo wrote:but the revOpenDatabase ("mysql","localhost","test","root",""")
Is that the exact string? If root has no password then i'm pretty sure the last parameter should be "" not """. I am also unsure whether the database identifier is case sensitive, did you try "MySQL"?
I'm not the database specialist that Jan is but maybe this helps you nonetheless :)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

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

Re: revOpenDatabase on Linux

Post by Janschenkel » Sat Apr 15, 2006 7:27 pm

Hi Riccardo,

If you keep getting this error inside the IDE, I'm not sure what is causing it - you shouldn't have to change the database driver path in the IDE.

That being said, it looks like you have the correct (lowercase) name, so that should work. The only other thing I can think of right now, is that you're missing the fifth parameter - the useSSL flag.

Code: Select all

put revdb_connect("mysql";"localhost","test","root","",false) into tConnectionID
Unfortunately, I don't have a Linux machine atm to verify.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

riccardo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 13
Joined: Sat Apr 15, 2006 10:03 am
Location: Italia

Post by riccardo » Sat Apr 15, 2006 7:48 pm

BvG, you are right, I have made a mistake in copy and past the command string.
I beleave that the exact string for an user with no password is "", but I have made a lot of attempts and I have noted that the error depends only by the first parameter of the command. (it doesn'nt change if I use different user, password or db )
I have tried with "mysql", "MySQL", "MYSQL" and the results is always the same.

I have tried the following steps too:
-to make a copy of dbmysql.so in revolution directory;
-to set the permissions of revolution files and directories to rwxrwxrwx
-to install MySQL Server 5.0 and 4.1
but the error result is always the same.

riccardo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 13
Joined: Sat Apr 15, 2006 10:03 am
Location: Italia

Post by riccardo » Thu Apr 20, 2006 3:03 pm

Hi Jan,
As you suggest I have tried too:
put revdb_connect("mysql","localhost","test","root","",false) into tConnectionID
but the result is always:
revdberr,invalid database type

Can I try anything else?
Thanks

rishi
Posts: 25
Joined: Wed Apr 12, 2006 12:23 am
Location: Australia
Contact:

Post by rishi » Thu May 04, 2006 1:41 am

riccardo,

I can vouch for MySQL + Rev working! :)
But, it was a big headache getting the driver to work.

On the pedantic syntax side, don't forget that in Linux you need to escape your spaces when you give a path on the command line. So this:
revSetDatabaseDriverPath "/home/amministratore/Desktop/Revolution-2.6.1/components/global environment/database_drivers/Linux/"
would become this:

Code: Select all

revSetDatabaseDriverPath "/home/amministratore/Desktop/Revolution-2.6.1/components/global\ environment/database_drivers/Linux/"
note the small difference of the added "\" backslash. This may not be your problem, but I thought it was worth noting.

You also need to make sure the driver version works with your MySQL version. To check if the database drivers work on the machine you are using, run the comand line tool "ldd". At the command line, change directory to the database driver file (like dbmysql.so) and then run:

Code: Select all

#ldd dbmysql.so
This will list all of the dependencies of the driver file and indicate if the dependencies are not met by stating that the item is "not found". Solve the dependencies to get the database driver working.

Easier said than done! :shock:

Hope this helps.
--
Rishi Viner
Australia

riccardo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 13
Joined: Sat Apr 15, 2006 10:03 am
Location: Italia

Post by riccardo » Fri May 05, 2006 8:32 am

Hi Rishi,
Thanks to you for your contribute too.
Finally I solved my connection problem to MySQL DBNS with the help of Runtime Support.

As Rishi suggested it was due to the dipendencies of dbmysql.so library used by revolution.
Using ldd command you can discover what modules are not present in the system.
The major problem has been about libmysqlclient.so.12 required by dbmysql.so.
It is an old library for Mysql version 4.0.x while in my system I had libmysqlclient.so.14 and there was a conflict between libmysqlclient.so.12 and libmysqlclient.so.14.
I have tried the installation on different systems: Mandriva, Suse, Debian (all in current release) with MySQL 4.1 and Mysql 5.0 and I had the same problem on all configurations.

It could be a good idea to upgrade the dbmysql.so library in the next version of revolution for linux.
At the moment I hope that this can help everyone use mysql and revolution.

rishi
Posts: 25
Joined: Wed Apr 12, 2006 12:23 am
Location: Australia
Contact:

Post by rishi » Sat May 06, 2006 10:31 am

Hi Riccardo,

Glad to hear you got it working!

This problem comes up with many software packages, not just Rev. You should be able to get Rev working with newer versions of MySQL by installing compatibility libraries, called "compat" by MySQL. Have a look at this page on the MySQL web site.

I am running Rev with a 4.1.x version of MySQL even though its driver only supports 4.0.x versions. The compat package takes care of the differences and provides the "libmysqlclient.so.12" that is required.

Hope this helps. Cheers,
--
Rishi Viner
Australia

gragon
Posts: 14
Joined: Thu Nov 30, 2006 3:54 am

Post by gragon » Wed Feb 07, 2007 8:58 pm

How does this affect those who receive our applications? Will my users be required to take the same steps before run-time, or is this just a compile-time problem?

Is there a way we can build a the rev dbmysql.so ourselves so we can create a version that supports our user's configuration?

siphosethun
Posts: 1
Joined: Thu Jan 25, 2007 8:25 am

Post by siphosethun » Tue Feb 13, 2007 2:39 pm

hi
can you help me out, i have built my application on runrev studio 2.6 and would like to deploy a standalone in linux , the application was built on win 32 , i am using mysql database, and have downloaded the xampp to run on linux , how do i deploy my application to run on linux?

sipho

Post Reply

Return to “Databases”