Switching from sqlite to mySQL

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
Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Switching from sqlite to mySQL

Post by Quinton B. » Thu Jun 15, 2017 10:34 pm

Hello

So I understand that SQLite is a localized within the application in writing. How do I switch to MySQL, as the application will need to connect to a server? How do I set this stuff up, I have no idear how to. Currently, I have a server rack running Ubuntu Linux distro 16.04. How do I switch from SQLite to MySQL?

mrcoollion
Posts: 738
Joined: Thu Sep 11, 2014 1:49 pm

Re: Switching from sqlite to mySQL

Post by mrcoollion » Fri Jun 16, 2017 8:26 am

Hello Q,

Basically you need to do the following:
1) Install your MySQL Database service on a server in your network.
2) Add your Database and tables to the MySQL service.
Now you have Database name, Servername, IP Adress, portnumber, userID and User password to access the database.
3) Use this information with revOpenDatabase (see dictionary) to open the channel to the Database to use it in liveCode

Code: Select all

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
            else
                put empty into gConnectionID
                answer error "Unable to connect to the database:" & cr & tResult
            end if
Hope this helps,

Regards,

Paul

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Switching from sqlite to mySQL

Post by MaxV » Mon Jun 26, 2017 5:08 pm

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply