Livecode not connecting to cPanel depending on location

This is the place to discuss the LiveCode Hosting service.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mturney
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Mon May 09, 2011 3:01 pm

Livecode not connecting to cPanel depending on location

Post by mturney » Mon Mar 04, 2019 5:20 pm

I read through some of the topics for cPanel use. Not sure if I need to add a new topic and apologies if someone has addressed this on another topic area. I am having connection issues with Livecode and cPanel. I use a MacBook Pro at work and at home. I am developing a Livecode app that makes calls to cPanel with the following script:

In a button called “connect”:
on mouseUp
global gConnectionID
put "lc680611.on-rev.com" into tDatabaseAddress
put "lc680611_shortMedList" into tDatabaseName
put "lc680611_mturney" into tDatabaseUser
put "°°°°°°°" into tDatabasePassword —(passwd is withheld for this discussion)
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
if tResult is a number then
put tResult into gConnectionID
answer info "Connected to the database." & cr & "Connection ID = " & gConnectionID
set the backgroundcolor of me to green — to indicate connection to the DB
else
put empty into gConnectionID
answer error "Unable to connect to the database:" & cr & tResult
set the backgroundcolor of me to red
end if
end mouseUp

When at work, I get a result that says
“Connected to the database”. Connection id= 87 (or other number)

When at home, I get the result that says

“Unable to connect to the database:
Access denied for user
“lc680611_mturney’@’74-196-70-167.amrlcmtk06.res.dyn.suddenlink.net'
(using password: YES)


I checked my cPanel security and I don’t have any IP addresses in the IP blocker. Not sure if this is my internet provider at home blocking my calls to cPanel. Any suggestions as to how to fix this? Thanks!

matt

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Livecode not connecting to cPanel depending on location

Post by sphere » Wed Apr 24, 2019 1:13 pm

No answer still?...
You are trying to connect to your Database, not cPanle itself so to see.
Maybe you have no IP set in your blocker, but maybe you have only allowed the IP from your work to be able to connect to your DB.
You can set your DB to allow all connections, setting it open to anyone in the world.(you dont't want that i believe)

You need to use some middleware, in between your app and your DB. That is if you want your app to be used by others. If not then you need to set your IP's from work and Home to allow access to your DB. This you set in cPanel.
Mostly localhost is also set in cPanel, and for this you need the middleware in the form of LC (if you have lc server) or PHP or whatever to communicate with your DB from anywhere in the world.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Livecode not connecting to cPanel depending on location

Post by FourthWorld » Wed Apr 24, 2019 4:50 pm

If I understand the situation correctly, offline I've been informed that he has a solution. While he wasn't blocking IPs, he also wasn't opening them, which would be needed for Internet access to the DB as configured.

And yes, he's aware of the need to use a protective middle layer between the DB and the Internet, in progress.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Livecode not connecting to cPanel depending on location

Post by sphere » Wed Apr 24, 2019 8:41 pm

Ah ok that's great! Thanks Richard.

Post Reply

Return to “LiveCode Hosting”