How to use revOpenDatabase

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Location: Palo Alto, CA put williamdjamieso into tEmail / put n@gmail.com after tEmail/ revmail tEmail
Contact:

How to use revOpenDatabase

Post by William Jamieson » Mon Nov 02, 2015 7:10 pm

Hello,

I was wondering if someone has figured out how to get this one line of code to work.

Code: Select all

get revOpenDatabase("mysql", "localhost", tDbName, tUsername, tPassword)
A little about the setup:
Linux server running LC 8.0 DP 7 Com Server
Apache/2.2.22 (Ubuntu)
MySQL client version: 5.5.44
Server: Localhost via UNIX socket
Server version: 5.5.44-0ubuntu0.12.04.1

And it seems like no matter what I do, this function will not return an id.

Every other Livecode command and function seem to be working OK. It is just this one. There are no typos on the DbName, Username, and Password

Has anybody experienced this before? What do you think could be the issue?

-Will

SparkOut
Posts: 2407
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to use revOpenDatabase

Post by SparkOut » Tue Nov 03, 2015 7:40 pm

If this is a LiveCode script on a Linux web server, try replacing "localhost" with "127.0.0.1"

MaxV
Posts: 1577
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to use revOpenDatabase

Post by MaxV » Wed Nov 04, 2015 6:11 pm

SparkOut is right, please note that you could specify also the port:

Code: Select all

get revOpenDatabase("mysql", "127.0.0.1:3306", tDbName, tUsername, tPassword)
What port do you use for MySQL? Usually is 3306, but if you changed the standard installation, use the correct port.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

William Jamieson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 212
Joined: Fri Feb 01, 2013 1:31 am
Location: Palo Alto, CA put williamdjamieso into tEmail / put n@gmail.com after tEmail/ revmail tEmail
Contact:

Re: How to use revOpenDatabase

Post by William Jamieson » Wed Nov 04, 2015 6:36 pm

Yes, I believe that worked. I did not specify 3306 but I changed localhost to 127.0.0.1 and it works. Thanks!

Post Reply

Return to “Databases”