2011-02-27 78 views
3

我試圖用DirectAdmin導入,當我選擇CSV而不使用LOAD DATA時 - 我得到了錯誤「第1行CSV輸入中的無效字段數」。將CSV導入到MySQL表中會返回一個錯誤#1148

當我嘗試使用LOAD DATA時,出現以下錯誤:「#1148 - 使用的命令不允許使用此MySQL版本。」

CSV是從MS Access數據庫的MS Access中創建的。

這裏是前2行:

"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 " 
+1

也許這是'קרוגרוזה」,'這*似乎*有缺失雙報價?(不知道,因爲從左到右很難說) –

+0

還有其他的報價違規行爲...例如「2, – markus

+0

我檢查了報價,甚至刪除了文件中的所有報價,但沒有報價沒有幫助。 – Dean

回答

5

從MySQL命令行通過下列參數:

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

代替使用:load data infile,使用:load data local infile,它應該執行導入。

默認情況下,MySQL不支持load data local按這裏定義的安全顧慮:

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

If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:

ERROR 1148: The used command is not allowed with this MySQL version

+1

即使指定了' - local-infile',我仍然收到錯誤1148,MySQL 5.5 –