I am using MySQL version 5.5 and I am trying to use load data infile and I am getting errors. I've looked at the documentation and it looks like I am doing exactly what the docs specify.
Running this command in mysql
LOAD DATA local infile '/home/pi/Downloads/load_data_infile.txt'
INTO TABLE test_tbl FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Gives the following error.
ERROR 1148 (42000): The used command is not allowed with this MySQL version
Running the following command
LOAD DATA local-infile '/home/pi/Downloads/load_data_infile.txt'
INTO TABLE test_tbl FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
Gives the following error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-infile '/home/pi/Downloads/load_data_infile.txt' INTO TABLE test_tbl FIELDS TER' at line 1
What is wrong with my syntax? The data in the file is
126,126text,moretext
127,127text,moretext
LOCAL
? does your client works with remote MySQL, and source file is local for client and remote for server really? Check doesLOAD FILE LOCAL
allowed both on server and on cilent side either by proper settings in INI file or by proper command line options.ini
file but that could lead it issues.