问题
I'm running the following command within PHPmyadmin:
LOAD DATA INFILE '/test3.csv' INTO TABLE temp_car FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (recloc,divdept)
AND
LOAD DATA INFILE '/var/www/vhosts/domain.com/httpdocs/admin/server/test3.csv' INTO TABLE temp_car FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (recloc,divdept)
i get this error:
#1045 - Access denied for user 'db_admin'@'%' (using password: YES)
I've tried changing the permissions to the file to 777 and the containing folder to 777.
Any ideas? I'm having a terrible time getting a working test with LOAD DATA INFILE
回答1:
"For security reasons, when reading text files located on the server, the files must either reside in the database directory or be readable by all. Also, to use LOAD DATA INFILE on server files, you must have the FILE privilege."
来源:https://stackoverflow.com/questions/4443352/load-data-infile-within-phpmyadmin