Page 1 of 1

How to use revOpenDatabase

Posted: Mon Nov 02, 2015 7:10 pm
by William Jamieson
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

Re: How to use revOpenDatabase

Posted: Tue Nov 03, 2015 7:40 pm
by SparkOut
If this is a LiveCode script on a Linux web server, try replacing "localhost" with "127.0.0.1"

Re: How to use revOpenDatabase

Posted: Wed Nov 04, 2015 6:11 pm
by MaxV
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.

Re: How to use revOpenDatabase

Posted: Wed Nov 04, 2015 6:36 pm
by William Jamieson
Yes, I believe that worked. I did not specify 3306 but I changed localhost to 127.0.0.1 and it works. Thanks!