Standalone not connecting to mySQL

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Standalone not connecting to mySQL

Post by kaveh1000 » Tue Dec 04, 2018 8:38 pm

I have a stack that reads and writes correctly to a mySQL database, but a Mac Standalone created from it is not connecting. I have the following Inclusions checked in preferences:

mySQL
Database
SSL & Encryption


And I have included the following the following line in my stack to check for internet connectivity:

Code: Select all

put url "http://www.google.com" into tURL
   if tURL is empty then
      answer "Could not update preferences. Using local prefs"
      exit get_remote_prefs
   end if
and it fails to connect in this handler

Ideas pls?
Kaveh

AndyP
Posts: 381
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Standalone not connecting to mySQL

Post by AndyP » Wed Dec 05, 2018 9:11 am

Are you using a V8.XX community version?

I've noticed that in the HTTP inclusion is often not listed or included in some of the 8 versions, this applies to manual or automatic inclusion settings.

So I tested with 8.1.4 community and see the error using the following.

Code: Select all

on mouseUp
   put url "http://www.google.com" into tURL
   if tURL is empty then
      answer "Could not update preferences. Using local prefs"
      exit to top
   else
      answer "OK"
   end if
end mouseUp
Using Community 9.0.2 (rc2)
All works as expected.
If manually setting inclusions include the HTTP library
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Standalone not connecting to mySQL

Post by kaveh1000 » Wed Dec 05, 2018 10:47 am

Hi Andy

I am using 9.0.2 (rc 2)

I am using manual inclusion, but can see only HTTPD library, not HTTP. Adding that one did not help. Should there be an HTTP library in the list of inclusions?

K
Kaveh

AndyP
Posts: 381
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Standalone not connecting to mySQL

Post by AndyP » Wed Dec 05, 2018 11:14 am

Yes should have been HTTPD not HTTP..sorry

Do you get the same problems if you automatically select inclusions?
Andy Piddock

http://2108.co.uk/tinyide/ - TinyIDE gives you more space to develop your ideas

http://2108.co.uk/script-editor-themer/ Script Editor Themer - Your code has never looked so good

My software never has bugs. It just develops random features

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Standalone not connecting to mySQL

Post by kaveh1000 » Wed Dec 05, 2018 1:52 pm

Interesting. With automatic settings, it gets past the fisrt stage, but gives me a different error:

Unable to connect to the database: revdberr, invalid database type

So the web connection is fine, but mySQL connection is not...
Kaveh

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

Re: Standalone not connecting to mySQL

Post by FourthWorld » Wed Dec 05, 2018 8:23 pm

Unless all connectivity to the DB is restricted to your local network, an HTTP-based API (RESTful or otherwise) is safer than directly exposing MySQL to the open Internet.

LiveCode Server can be used in such an intermediary role, as can Python, Perl, PHP, or nearly anything else you're comfortable with that can be run as a CGI under Apache.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Standalone not connecting to mySQL

Post by kaveh1000 » Wed Dec 05, 2018 8:28 pm

Thank you so much Richard. Point taken about security. But it is getting out of my comfort zone, so will have to consult colleagues about an API.

But for now, and before I release this to the world, it would be good to know how I can get this fixed. it is a test database anyway. So any pointers there would be great.
Kaveh

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

Re: Standalone not connecting to mySQL

Post by FourthWorld » Wed Dec 05, 2018 9:11 pm

This LiveCode Lesson provides guidance on connecting to a database from LiveCode Server:
http://lessons.livecode.com/m/4071/l/70 ... l-database

It's so rare that one would connect to a database over the open Internet that I'm not familiar with a lesson for that, but hopefully the details at that link will help there as well.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Standalone not connecting to mySQL

Post by kaveh1000 » Wed Dec 05, 2018 9:25 pm

Thanks Richard

Actually that was the procedure I followed and all is fine in the LiveCode app. But not connecting in standalone, although I have tried enabling all the right inclusions.

Thanks again and other opinions welcome.

In the meantime I will look into APIs...
Kaveh

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

Re: Standalone not connecting to mySQL

Post by SparkOut » Wed Dec 05, 2018 9:52 pm

Probably your ISP automatically blocks direct connection to the database from the internet, as it is such a terrible vulnerability. If you really MUST make direct connection (please, please only temporarily, just to confirm your database updates are ok) then check in your control panel. You will like have to specify the IP address of allowed connections, or (for the love of everything you hold dear, please don't) use a wildcard to permit connection from anywhere and everywhere by anyone and everyone.

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 83
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Standalone not connecting to mySQL

Post by kaveh1000 » Thu Dec 06, 2018 7:54 pm

Thank you SparkOut. I cannot ignore your passionate plea!! I will work on a better method of access... ;-)
Kaveh

Post Reply

Return to “Databases”