mySQL connection to a port
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
mySQL connection to a port
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.
Any suggestions on this please?
Thanks.
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
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.
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.
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
Hope this gets you closer to a solution,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
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.
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Kris,
revOpenDatabase is documented incorrectly. The correct syntax is:
What you want is this:
revOpenDatabase is documented incorrectly. The correct syntax is:
Code: Select all
revOpenDatabase(type, host, name, username, password, port, useSSL)
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
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
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:
Thanks,
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:
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?get revOpenDatabase("MySQL","www.example.com","RatesDB",myUsr,myPass,0)
Thanks,
--
Rishi Viner
Australia
Rishi Viner
Australia
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
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
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