在 MySQL 中加载数据 infile 的访问被拒绝
我一直在 PHP 中使用 MySQL 查询,但是当我尝试时
I use MySQL queries all the time in PHP, but when I try
LOAD DATA INFILE
我收到以下错误
#1045 - 用户 'user'@'localhost' 的访问被拒绝(使用密码:YES)
#1045 - Access denied for user 'user'@'localhost' (using password: YES)
有人知道这是什么意思吗?
Does anyone know what this means?
推荐答案
我也刚遇到这个问题.我不得不将 LOCAL
添加到我的 SQL 语句中.
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}
将 LOCAL
添加到您的语句中,权限问题就会消失.像这样:
Add LOCAL
to your statement and the permissions issue should go away. Like so:
LOAD DATA LOCAL INFILE '{$file}' INTO TABLE {$table}
相关文章