Mysql 权限错误“加载数据”;
当我尝试将平面文件数据库转储中的数据加载到新表中时,遇到权限错误。 我知道文件的架构和我的表是相同的,我尝试调整权限。 我还应该尝试什么?
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'@'%
I am running into a permission error when trying to load data from a flat file database dump into a new table. I know that the schema of the file and my table is the same and I tried tweaking the permissions. What else should I try?
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'@'%
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一个 MySQL 论坛上的主题,专门讨论了这个问题。
这是 Ken Tassel 发布的答案
Here's a thread on the MySQL forums that discusses exactly this.
Here's the answer, posted by Ken Tassell
您可能对目标表具有 MySQL 权限,但还需要 FILE 权限来执行 LOAD DATA,当然 MySQL Server 进程需要操作系统权限来执行 LOAD DATA。数据文件也是如此。
You might have MySQL privileges on the destination table, but you also need the
FILE
privilege to executeLOAD DATA
, and of course the MySQL Server process needs operating-system privileges to the data file too.