Page 1 of 1

Problem with LOAD DATA LOCAL INFILE

Posted: Sun Jan 31, 2021 10:46 pm
by mihmih
Hello,

I'm using Libreofice base with Mysql 8 (java connector 8.0.21) and in one of the macros I have an instruction with LOAD DATA LOCAL INFILE.

And this macro does not want to be executed, an error appears:
"Loading local data is disabled; this must be enabled on both the client and server sides."

---other facts:
- LOAD LOCAL INFILE works
- in the MySql my.ini configuration file in [client] and [mysqld] I added "local_infile" (maybe should be "local_infile = 1" or "local_infile = ON"?)
- in Libreoffice settings - advanced - java environment options - parameters: I added "-allowLoadLocalInfile = true"

What else would I have to do to be able to import csv files from a local disk? Thanks for all the help.

Re: problem with LOAD DATA LOCAL INFILE

Posted: Sun Jan 31, 2021 10:53 pm
by Villeroy
Open the csv with Calc and open the Base document.
When opening the file with Calc, make sure that the "special numbers" option is checked.

Copy the cell range.
In the database window right-click the table icon and choose "Paste".
A dialog pops up. Make sure that action "Append data" is selected, that the right table name is given and check option "contains column labels" if your copied cell range includes any column headers.
In the next step of the dialog you can map the source columns to the right target columns.

Re: Problem with LOAD DATA LOCAL INFILE

Posted: Mon Feb 01, 2021 10:44 am
by mihmih
Thanks for the answer.

I don't want to do it manually, there are additional options in the LOAD DATA statement that can be done automatically and that you can't do manually.

It seems that somewhere in Base you should paste the command "allowLoadLocalInfile = true", but I don't know where ....

or maybe someone knows if you can enter the path to the network drive in the LOAD DATA parameter?

Re: Problem with LOAD DATA LOCAL INFILE

Posted: Mon Feb 01, 2021 1:06 pm
by Villeroy
You can send commands to the connected database via Tools>SQL...

Re: Problem with LOAD DATA LOCAL INFILE

Posted: Mon Feb 01, 2021 3:51 pm
by mihmih
yes I know about it. However, I have to do it through a macro through the LOAD DATA instruction, because the macro takes from the form some data needed in the instruction and you can also update the data in this instruction