This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Mysql access from lp file
#1
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
Reply
#2
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.
Reply
#3
(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...
Reply
#4
Then you can try fetching the data directly from MySQL in the .lp file.
Reply


Forum Jump: