Page 1 of 1

Switching from sqlite to mySQL

Posted: Thu Jun 15, 2017 10:34 pm
by Quinton B.
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?

Re: Switching from sqlite to mySQL

Posted: Fri Jun 16, 2017 8:26 am
by mrcoollion
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

Re: Switching from sqlite to mySQL

Posted: Mon Jun 26, 2017 5:08 pm
by MaxV