mySQL connection to a port

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kris
Posts: 2
Joined: Tue Jun 13, 2006 10:37 am

mySQL connection to a port

Post by kris » Tue Jun 13, 2006 12:40 pm

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.

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 Jun 13, 2006 6:38 pm

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

kris
Posts: 2
Joined: Tue Jun 13, 2006 10:37 am

Post by kris » Tue Jun 13, 2006 8:56 pm

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.

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Wed Jul 26, 2006 5:31 pm

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 
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

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

Post by rishi » Tue Aug 01, 2006 2:36 am

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,
--
Rishi Viner
Australia

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Tue Aug 01, 2006 2:51 pm

Yes, the bug was filed just the other day. As for SSL, you use either 1 or 0.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “Databases”