1

I'm completely novice to MySQL, and I'm trying to load some CSV sheets to the server using HeidiSQL -> tools -> Import CSV. But it keeps giving me this error:

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

Is there a way to fix that, or maybe another way to load a CSV?

reisdev
  • 3,215
  • 2
  • 17
  • 38
EwokJedi
  • 25
  • 2
  • Possible duplicate of [How to import CSV file to MySQL table](https://stackoverflow.com/questions/3635166/how-to-import-csv-file-to-mysql-table) – g_bor Nov 05 '19 at 21:41

2 Answers2

0

For query based csv import you can use load data ... to load csv files.

For more info refer here

Example:

To skip the first line which is header in csv you can use ignore 1 lines

load data local infile 'D:std_table.csv' into table local.student
fields terminated by ','
enclosed by '"' 
lines terminated by '\r\n'
ignore 1 lines;

For windows based system use \r\n for line termination and for Linux use \n

Side Note:

You could try using MySQL Workbench for MySQL from official site here.

James
  • 1,819
  • 2
  • 8
  • 21
-1

try this one:

LOAD DATA INFILE 'c:/tmp/discounts.csv' 
INTO TABLE discounts 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
Max
  • 44
  • 2