LOAD DATA LOCAL INFILE php mysql

时间:2012-12-20 20:08:56

标签: php mysql

我收到错误

#7890 - Can't find file 'C:UsersAdminDesktopBL postcodes.csv.zip'.

这是脚本

LOAD DATA LOCAL INFILE 'C:\Users\Admin\Desktop\BL postcodes.csv.zip' 
IGNORE INTO TABLE uk_pc 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 
(Postcode, Latitude, Longitude, Easting, Northing, GridRef, County, District, Ward, DistrictCode, WardCode, Country, CountyCode)

我试图更改文件夹并更改权限但是同样的错误...(在localhost服务器上工作)

2 个答案:

答案 0 :(得分:4)

'C:UsersAdminDesktopBL postcodes.csv.zip'路径必须是错误的,因为它不会有尾部斜杠。尝试:INFILE 'C:\\Users\\Admin\\Desktop\\BL postcodes.csv.zip'

尝试解压缩文件。

答案 1 :(得分:-1)

使用如下的本地infile:

加载数据本地infile' C:\ Users \ Admin \ Desktop \'进入表用户