Connecting to 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
montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Connecting to database

Post by montymay » Tue May 03, 2016 7:33 pm

For my application I have decided of late that I should use a remote database rather than creating thousands of cards.(I am studying MySQL in an online course.) I have an Indy license so I have access to the on-rev.com hosting service though the cPanel, which includes a simple procedure for creating a MySQL database. I created one but I have not found a clear explanation on how to connect to it. The tutorial http://lessons.livecode.com/m/4071/l/70 ... l-database was the closest to it, but it is not clear about the content of the database address. Just entering myURL/mydatabasename does not work. I read something about to need to include one's IP address, but if that's true, I don't know how. I know I have a lot to learn, but for now all I want to know is how to connect and disconnect to the database I created in the cPanel. Thank you for any tips or pointers.

Monty

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Connecting to database

Post by Da_Elf » Tue May 03, 2016 8:19 pm

they online database has to accept your ip address meaning that you have to have a static ip address from your ISP

montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Re: Connecting to database

Post by montymay » Tue May 03, 2016 11:22 pm

On the cPanel there is a button named "My Remote SQL" that opens the following panel. Although to this novice its use is not clear, is it possible that one can enter one's dynamic (non-static) IP address and then access the database? AFAIK, getting a static IP address from one's ISP will be costly.
Capture.JPG
Capture.JPG (30.78 KiB) Viewed 5619 times
It so, then how is the database address formulated? If this is not its use, what is it for?

If the "My Remove SQL" feature isn't for users without static IP addresses, is there some workaround that does not require buying a static IP address?

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Connecting to database

Post by Da_Elf » Wed May 04, 2016 2:17 am

thats why i usually have my database local. i just setup mysql on my computer

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Connecting to database

Post by Simon » Thu May 05, 2016 1:59 am

Hi Montymay,
Check out this link and the blog it leads to;
http://forums.livecode.com/viewtopic.ph ... 15#p124003
This is the secure way of accessing your DB.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Re: Connecting to database

Post by montymay » Fri May 06, 2016 7:20 am

Thanks, Simon, for the link. I had come across it in searching the forum but did not realize its relevance to my problem. Correct me if I am misstate the gist of the solution: those with dynamic IP addresses must write and install on the server a php file that acts as a go-between (hence: middleware) between the remote MySQL database and the LC application on the local machine. I see mentions of a simpler alternative solution: installation of Livecode Server on the server, so it would seem that the latter technique should be studied before going "all in" on the first. So for now I think I will begin the study of php and MySQL, with side glances at Livecode Server, and see how it goes.

Monty

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Connecting to database

Post by Simon » Fri May 06, 2016 7:42 am

Hi Monty,
It's that "My Remote SQL" worries me a whole bunch.
I'm not an internet security guy but putting a wildcard in that seems crazy.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply