Problem with LOAD DATA LOCAL INFILE

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Problem with LOAD DATA LOCAL INFILE

Post 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.
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: problem with LOAD DATA LOCAL INFILE

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Problem with LOAD DATA LOCAL INFILE

Post 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?
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Problem with LOAD DATA LOCAL INFILE

Post by Villeroy »

You can send commands to the connected database via Tools>SQL...
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Problem with LOAD DATA LOCAL INFILE

Post 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
LibreOffice 4.2 on Windows7
Post Reply