【问题标题】:Mysql permission errors with 'load data''加载数据'的Mysql权限错误
【发布时间】:2010-11-04 02:58:20
【问题描述】:

尝试将平面文件数据库转储中的数据加载到新表时遇到权限错误。我知道文件的架构和我的表是相同的,我尝试调整权限。我还应该尝试什么?

mysql> load data infile 'myfile.txt' into table mytable fields terminated by ',' enclosed by '"';
ERROR 1045 (28000): Access denied for user 'user'@'%' 

grant all on mytable.* to 'user'@'%

【问题讨论】:

标签: mysql load-data-infile mysql-error-1045


【解决方案1】:

您可能对目标表拥有 MySQL 权限,但您还需要FILE 权限才能执行LOAD DATA,当然 MySQL Server 进程也需要对数据文件具有操作系统权限。

【讨论】:

  • 感谢您对问题的描述。帮助了我!
【解决方案2】:

Here's a thread 在 MySQL 论坛上讨论了这个问题。

这是答案,由 Ken Tassell 发布

使用以下命令解决问题:

grant file on *.* to kentest@localhost identified by 'kentest1';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-12
    • 1970-01-01
    • 2013-10-02
    • 2016-02-14
    相关资源
    最近更新 更多