Logic Machine Forum
Mysql access from lp file - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Mysql access from lp file (/showthread.php?tid=4327)



Mysql access from lp file - jmir - 28.10.2022

Hi,

Is there any way to get data from an external mysql server from a lp file?
And if it's possible, how to manage database connection credentials in a secure way.

I need it to display mysql data on a table in the visualitzation.

Thanks


RE: Mysql access from lp file - admin - 28.10.2022

You can use MySQL functions in .lp, but it might cause problems if the db server is not available as .lp should not contain any blocking code. Alternatively if you don't need data in real time you can fetch data from MySQL via a script, save data into storage and display it via .lp.
There's no completely secure way to hide the credentials. You should limit db user privileges to only functions/tables that are needed.


RE: Mysql access from lp file - jmir - 28.10.2022

(28.10.2022, 06:24)admin Wrote: You can use MySQL functions in .lp, but it might cause problems if the db server is not available as .lp should not contain any blocking code. Alternatively if you don't need data in real time you can fetch data from MySQL via a script, save data into storage and display it via .lp.
There's no completely secure way to hide the credentials. You should limit db user privileges to only functions/tables that are needed.

I've done as you say, using a script and saving data into storage.

Doing like this there is a little issue... in the page there is a date button (used to compose the sql sentence) and a retrieve data button (to execute the script to fecth sql data and save in storage), if two users have the page loaded at the same time, the values change form both...


RE: Mysql access from lp file - admin - 31.10.2022

Then you can try fetching the data directly from MySQL in the .lp file.