Import CSV files into MySQL using LOAD DATA LOCAL INFILE

0

I used the following script to import a .csv file into MySQL using MySQL WorkBench :

USE test;

LOAD DATA LOCAL INFILE 'exemplo1.csv' INTO TABLE tabela1 fields terminated by ';' lines terminated by '\r';

I've seen a number of other sites using only the LOAD DATA INFILE command, but my script only works by adding the LOCAL keyword. Does anyone know what it says it works for? And what is the purpose of being used or not.

    
asked by anonymous 13.06.2015 / 22:13

1 answer

2

The LOCAL keyword is used when the file is on another machine MySQL is running.

When you add LOCAL the file will be sent to the server, stored in a temporary folder, and run from there. This works only if the required permissions are set.

    
13.06.2015 / 23:16