开发者

mysql load data infile permission issue

开发者 https://www.devze.com 2023-04-08 09:04 出处:网络
I am using the following query to load into mysql: LOAD DATA INFILE \'/var/www/vhosts/httpdocs/xml/insert_feeds.csv\'

I am using the following query to load into mysql:

LOAD DATA INFILE '/var/www/vhosts/httpdocs/xml/insert_feeds.csv' 
INTO TABLE `deals_items` 
FIELDS TERMINATED BY '@##!@#' 
OPTIONALLY ENCLOSED BY '' 
ESCAPED BY '' 
LINES TERMINATED BY '@##%@#' 
IGNORE 1 LINES 
(@id,dealID,shopid,categoryid,title,permalink,url,startDate,endDate,description,extract,price,previous_price,discount,purchases,image,@location,@lat,@lng,locationText,type,settings,active) 
SET id = '', lat=@lat, lng=@lng, locationText=@location, location = GeomFromText(CONCAT(POINT(@lat,@lng)))

Now this used to work just fine, but ever since an mysql was upgraded from 5.0 to 5.1 it stopped workin开发者_运维问答g. It now works only if I add the LOCAL to the statement. The error I'm getting is Can't get stat of /var/www/vhosts/httpdocs/xml/insert_feeds.csv The user was granted with full permissions to test it and the file was given 0777. It won't work from any client (mysql,mysqli,pdo and console). Adding the local solves all problems but there is a lot of queries and I cannot go on and change them all. Further more, as I understand from the manual there are security issues with the LOCAL command.

The exact mysql version is 5.1.58-1~dotdeb.0 and the client version 5.0.51a

0

精彩评论

暂无评论...
验证码 换一张
取 消