Page 1 of 1

Can't Connect to remote Mysql Database

Posted: Sun Feb 14, 2016 9:27 pm
by snop21
Good Day, Guys.

I will just ask I have a Database in my Computer I want to access it with my Mobile App created using livecode the problem was I cannot connect to Database

here's my script

put "mysql" into theDBType
put "192.168.1.18" into theDBHost
put "Survey" into theDBName
put "kenneth" into theDBUser
put "kenneth21" into theDBPassword
put revOpenDatabase( theDBType, theDBHost, theDBName, theDBUser, theDBPassword) into connectionID

My IP of my computer is 192.168.1.18

Is there's any wrong with my connection string?

Thank you, Livecoders. Any help is very much appreciated.

Regards

-Ken

Re: Can't Connect to remote Mysql Database

Posted: Sun Feb 14, 2016 9:38 pm
by SparkOut
Is the mobile device using a WiFi connection on the same network as the database computer?
If the device does not have an ip address in the same network then in the connection string you will need to supply the ip address of the external side of the router and set up forwarding rules on the router to forward appropriate traffic to the internal address of your computer.
Otherwise it might be firewall issues.

Re: Can't Connect to remote Mysql Database

Posted: Sun Feb 14, 2016 9:42 pm
by SparkOut
Ah, now I can see the picture, it looks like you are testing from the IDE on the same computer as the one running the database. While testing, try using "localhost" or "127.0.0.1" instead of the ip address in the connection string.

Re: Can't Connect to remote Mysql Database

Posted: Tue Feb 16, 2016 6:43 pm
by snop21
Hi sparkout,

I got this right already.. :))

Thank you very much.. :))


Regards

-Ken