Can't Connect to remote Mysql Database

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Can't Connect to remote Mysql Database

Post by snop21 » Sun Feb 14, 2016 9:27 pm

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
Attachments
Screen Shot 2016-02-15 at 4.35.25 AM.png

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Can't Connect to remote Mysql Database

Post by SparkOut » Sun Feb 14, 2016 9:38 pm

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.

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: Can't Connect to remote Mysql Database

Post by SparkOut » Sun Feb 14, 2016 9:42 pm

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.

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Can't Connect to remote Mysql Database

Post by snop21 » Tue Feb 16, 2016 6:43 pm

Hi sparkout,

I got this right already.. :))

Thank you very much.. :))


Regards

-Ken

Post Reply