Importing CSV table into MySQL returns error # 1148

I am trying to import using DirectAdmin when I selected CSV without using LOAD DATA - I got the error "Invalid number of fields in CSV input on line 1".

When I tried with LOAD DATA, I got the following error: "# 1148 - The command used is not allowed with this version of MySQL."

CSV was created in MS Access from the MS Access database.

Here are the first 2 lines:

"product_id","vendor_id"," product_parent_id","product_sku","product_s_desc ","product_desc","product_thumb_image ","product_full_image","product_publish","product_weight","product_weight_uom ","product_length ","product_width","product_height ","product_lwh_uom ","disp_order","price","sale","product_url ","product_in_stock","product_available_date","product_availability ","product_special ","product_discount_id ","ship_code_id ","cdate ","mdate ","product_name ","product_sales ","attribute ","custom_attribute ","product_tax_id ","product_unit ","product_packaging ","child_options ","quantity_options ","child_option_ids ","product_order_levels "
41,2,0,1,,,"resized/Krug-Rose-Champagne-lg.jpg","Krug-Rose-Champagne-lg.jpg","Y","750.0000","grams","4.0000","4.0000",14,,14,3516,0,,,1296518400,,"N",0,"NULL ",1296574622,1297953843,"קרוג רוזה",0,,,2,"piece ",65537,"N,N,N,N,N,Y,20%,10%, ","none,0,0,1 ",,"0,0 "
+3
source share
1 answer

From the mysql command line, pass the following parameter:

mysql -u username -p dbname --local-infile

Instead of using: load data infileuse: load data local infileand it should complete the import.

By default, mysql does not turn load data localon for the security reasons mentioned here:

http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html

LOAD DATA LOCAL , , , , , :

1148: MySQL

+5

Source: https://habr.com/ru/post/1795052/


All Articles