Problem with LOAD DATA LOCAL INFILE

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER

Problem with LOAD DATA LOCAL INFILE

Postby mihmih » Sun Jan 31, 2021 10:46 pm

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
mihmih
 
Posts: 110
Joined: Wed Feb 18, 2015 9:21 pm

Re: problem with LOAD DATA LOCAL INFILE

Postby Villeroy » Sun Jan 31, 2021 10:53 pm

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
User avatar
Villeroy
Volunteer
 
Posts: 29709
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Problem with LOAD DATA LOCAL INFILE

Postby mihmih » Mon Feb 01, 2021 10:44 am

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
mihmih
 
Posts: 110
Joined: Wed Feb 18, 2015 9:21 pm

Re: Problem with LOAD DATA LOCAL INFILE

Postby Villeroy » Mon Feb 01, 2021 1:06 pm

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
User avatar
Villeroy
Volunteer
 
Posts: 29709
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Problem with LOAD DATA LOCAL INFILE

Postby mihmih » Mon Feb 01, 2021 3:51 pm

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
mihmih
 
Posts: 110
Joined: Wed Feb 18, 2015 9:21 pm


Return to External Data Sources

Who is online

Users browsing this forum: No registered users and 1 guest