Page 1 of 1

mySQL connection to a port

Posted: Tue Jun 13, 2006 12:40 pm
by kris
I can connect to a mySQL DB using the Run Revolution Database query builder to a specific port (e.g: 8889) but using the revOpenDatabase function revOpenDataBase("MySQL","127.0.0.1:8889","testdb","user","password") get an error of the host not found. I tried local Ip address also instead of the 127.x.x.x address but same result.
Any suggestions on this please?

Thanks.

Posted: Tue Jun 13, 2006 6:38 pm
by Janschenkel
Hi Kris,

The 'revOpenDatabase' function expects a fifth parameter for MySQL connections to indicate whether or not the connection should use SSL.
So try the following.

Code: Select all

put revOpenDataBase("MySQL","localhost:8889","testdb","user","password",true) into tConnectionID
answer tConnectionID
If the answer displays a number, you're good to go - otherwise you might want to doublecheck the port number, and check the firewall to see if it's not blocking that particular port.

Hope this gets you closer to a solution,

Jan Schenkel.

Posted: Tue Jun 13, 2006 8:56 pm
by kris
i tried the 5th parameter to set it to true/false (no SSL is setup). The MySQL is a localserver. Still I get a message Unknown MySQL server host 'localhost:8889' or '127.0.0.1:8889'. I also tried the actual IP address (192.168.0.x:8889). Happens with the reveOpenDatabase command. Going thru the Database Querybuilder in Tools menu and defining the parameter seems to work since the message comes back as connected for the port. I tried it on another system where the port is set to 3306 (default) and calling revOpenDatabase without port works.

Posted: Wed Jul 26, 2006 5:31 pm
by trevordevore
Kris,

revOpenDatabase is documented incorrectly. The correct syntax is:

Code: Select all

revOpenDatabase(type, host, name, username, password, port, useSSL)
What you want is this:

Code: Select all

put revOpenDataBase("MySQL","localhost","testdb","user","password","8889") into tConnectionID 

Posted: Tue Aug 01, 2006 2:36 am
by rishi
Hi Trevor,

Thanks very much for this, I didn't realise the documentation was wrong... lucky I don't use alternative ports much!

Do you know if this has a bug filed?

Also, can you confirm for me how the useSSL flag should be used?

The documentation would suggest that you don't use "true" or "false" for this, as shown in the doc's example:
get revOpenDatabase("MySQL","www.example.com","RatesDB",myUsr,myPass,0)
So the zero at the end is saying that I do/don't want to use SSL..? I presume it is 0 = don't use SSL, 1 = do use SSL. Can you confirm this?

Thanks,

Posted: Tue Aug 01, 2006 2:51 pm
by trevordevore
Yes, the bug was filed just the other day. As for SSL, you use either 1 or 0.