mySQL database access with ports

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
KennyR
Posts: 256
Joined: Thu Jan 19, 2012 4:25 am

mySQL database access with ports

Post by KennyR » Fri Apr 04, 2014 5:45 pm

Hey all....I am trying to connect to a godaddy.com mySQL database that I have and they have changed a few things up...now they are requiring an address that has a specific port and I am unsure if I am doing this correctly due to an error I keep getting....can someone take a look at the host connection line of the code and tell me if the syntax is correct for adding a port number to the address? Thanks...

Code: Select all

on mouseUp
     -- use a global variable to hold the connection ID so other scripts can use it
       global gConnectionID
      -- set up the connection parameters - edit these to suit your database
       put "p3nlmysql200plsk.secureserver.net:3303" into tDatabaseAddress
       put "someUser" into tDatabaseName
       put "someUser" into tDatabaseUser
       put "Password" into tDatabasePassword
       -- connect to the database
       put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
       -- check if it worked and display an error message if it didn't
      -- & set the connection ID global
       if tResult is a number then
             put tResult into gConnectionID
            //answer info "Connected to the database." & cr & "Connection ID = " & gConnectionID
       else
      
             put empty into gConnectionID
             answer error "Unable to connect to the database:" & cr & tResult
       end if
end mouseUp

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: mySQL database access with ports

Post by Klaus » Fri Apr 04, 2014 6:28 pm

Hi Kenny,

syntax is correct, but if I remember right, the datype needs to be in lowercase:
...
put revOpenDatabase("mysql", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
...

And make sure your provider does in fact allow direct access to the database!
Most provider require a "middleware" like PHP, Perl or even Livecode Server.


Best

Klaus

KennyR
Posts: 256
Joined: Thu Jan 19, 2012 4:25 am

Re: mySQL database access with ports

Post by KennyR » Fri Apr 04, 2014 6:38 pm

Hey Klaus....Yeah goDaddy has always allowed direct connect as far as I know...I changed the case and still no luck...I was wondering though....does LC support database types InnoDB and MyISAM? These are they types of DB I am using....

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: mySQL database access with ports

Post by Klaus » Fri Apr 04, 2014 6:41 pm

Hi Kenny,
KennyR wrote:...does LC support database types InnoDB and MyISAM? These are they types of DB I am using....
sorry, this knowledge is over my head 8)


Best

Klaus

KennyR
Posts: 256
Joined: Thu Jan 19, 2012 4:25 am

Re: mySQL database access with ports

Post by KennyR » Fri Apr 04, 2014 6:44 pm

now you know how I feel!!!! :P

Well I am not having any luck here...I was able to connect to the server before they moved to Plex....I contacted support and told them what I was attempting and they said all should be good....just use the address along with the port number and I would be good to go....I am wondering if there is something in LC preventing me from connecting...The error I get just appears like it can't contact the server....weird....

UPDATE: Think this is on goDaddy's site....working with them now...

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: mySQL database access with ports

Post by bangkok » Fri Apr 04, 2014 8:25 pm

KennyR wrote:Hey Klaus....Yeah goDaddy has always allowed direct connect as far as I know...I changed the case and still no luck...I was wondering though....does LC support database types InnoDB and MyISAM? These are they types of DB I am using....
I confirm : LiveCode can access MySQL databases, InnoDB and/or MyISAM.

What is exactly the error message you receive ?

Are you sure that goDaddy didn't change something ? They did change the port number, so maybe you should have a look at your admin interface, check if remote MySQL access is still allowed.

Other question : do you have access to your DB on goDaddy through a SQL Client software like HeidiSQL, with your current settings ?

KennyR
Posts: 256
Joined: Thu Jan 19, 2012 4:25 am

Re: mySQL database access with ports

Post by KennyR » Mon Apr 07, 2014 3:43 am

Sorry for not responding quickly but been working....I actually figured out it was my router screwing things up...I haven't investigated why yet, but I'm going to work on it this week. I tried another internet connection and found all was working as expected...thanks for all the help! U guys rock!

Post Reply