Mysql 权限错误“加载数据”;

发布于 2024-07-25 03:10:40 字数 297 浏览 8 评论 0原文

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

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青春有你 2024-08-01 03:10:40

这里有一个 MySQL 论坛上的主题,专门讨论了这个问题。

这是 Ken Tassel 发布的答案

使用以下命令解决了问题:

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

Here's a thread on the MySQL forums that discusses exactly this.

Here's the answer, posted by Ken Tassell

Problem resolved using the command below:

grant file on *.* to kentest@localhost identified by 'kentest1';
℉服软 2024-08-01 03:10:40

您可能对目标表具有 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 execute LOAD DATA, and of course the MySQL Server process needs operating-system privileges to the data file too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文