access denied for load data infile in MySQL

load-data-infile, mysql, mysql-error-1045

Solution

I just ran into this issue as well. I had to add `LOCAL` to my SQL statement.

For example, this gives the permission problem:

LOAD DATA INFILE '{$file}' INTO TABLE {$table}

Add `LOCAL` to your statement and the permissions issue should go away. Like so:

LOAD DATA LOCAL INFILE '{$file}' INTO TABLE {$table}

Problem

I use MySQL queries all the time in PHP, but when I try ``` LOAD DATA INFILE ``` I get the following error #1045 - Access denied for user 'user'@'localhost' (using password: YES) Does anyone know what this means?

Original source

Related problems