mysql-选择“进入(SQL错误(1045):访问用户test; test'@@'%'(使用密码:YES:YES))

发布于 2025-01-27 20:48:23 字数 581 浏览 5 评论 0原文

当我尝试使用以下查询导出记录时,我会收到错误

SELECT ID, Name FROM Emp 
INTO OUTFILE 'C:/temp/hash.csv' 
FIELDS ENCLOSED BY '"' 
TERMINATED BY ';' 
ESCAPED BY '"' 
LINES TERMINATED BY '\r\n';

错误:

SQL错误(1045):访问用户'test'@'%'(使用密码:是)

我在运行以下时会遇到相同的错误:

GRANT FILE ON *.* TO 'test';

SHOW VARIABLES LIKE "secure_file_priv";
secure_file_priv:  /tmp/

我想运行一个存储过程以通过.NET应用程序导出记录。我希望在Windows计算机上创建输出文件。 MySQL实例正在AWS上运行。我认为“ Secure_File_Priv”路径正在引起问题。在Windows Server上运行的另一个MySQL实例中,同样的查询正在使用。

谢谢。

When I try to export records using the below query, I am getting an error

SELECT ID, Name FROM Emp 
INTO OUTFILE 'C:/temp/hash.csv' 
FIELDS ENCLOSED BY '"' 
TERMINATED BY ';' 
ESCAPED BY '"' 
LINES TERMINATED BY '\r\n';

Error:

SQL Error (1045): Access denied for user 'test'@'%' (using password: YES)

I am getting same error while running the below:

GRANT FILE ON *.* TO 'test';

SHOW VARIABLES LIKE "secure_file_priv";
secure_file_priv:  /tmp/

I want to run a stored procedure to export the records through a .Net application. I am expecting the output file to be created on the windows computer. The MySQL instance is running on AWS.I think the "secure_file_priv" path is causing the issue. The same query is working in another MySQL instance that is running on windows server.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

三五鸿雁 2025-02-03 20:48:23

您需要先将CSV文件归档到AWS实例,然后将其下载到Windows计算机。

You need to out file the csv file to aws instance first, and then download it to your windows computer.

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