MySQL Load Data error 1148

if, while you are trying to load data, you receive the following error:

Error Code: 1148. The used command is not allowed with this MySQL version

you should perform the following steps:

1. Open terminal

By pressing ctrl+alt+T or any other way.

2. Login to mysql with –local-infile flag set

mysql -uroot -p --local-infile

3. Execute LOAD DATA LOCAL command.

Beware that you need to have read access to the file you want to import.

Then, execute the command as normal, eg:

LOAD DATA LOCAL INFILE '/blabla/data.csv' INTO TABLE YOURTABLE 
FIELDS TERMINATED BY '|' 
ENCLOSED BY '"' 
LINES TERMINATED BY '\n'  
IGNORE 1 LINES;

You can also look at this great troubleshooting article.

References:

  1. https://stackoverflow.com/questions/14038345/mysql-load-data-error-cant-resolve
  2. https://dba.stackexchange.com/questions/55960/mysql-import-csv-file-error-13-
  3. hy000-cant-get-stat-of-path-file-csv-errcod
  4. http://www.mysqltutorial.org/import-csv-file-mysql-table/
  5. https://matomo.org/faq/troubleshooting/faq_194/

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s