授予数据库用户文件夹访问权限
我正在尝试使用以下查询从 mysql 创建数据的 csv 导出:
SELECT * INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM getfreepellets WHERE 1
并且出现以下错误:(
#1045 - Access denied for user '[username]'@'localhost' (using password: YES)
删除了用户名,但它是正确的)
我将如何授予该用户访问权限以在服务器?
编辑:
我将第一行更改为我的确切主路径,并收到相同的错误。
I'm trying to create a csv export of data from mysql using the following query:
SELECT * INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM getfreepellets WHERE 1
And I get the following error:
#1045 - Access denied for user '[username]'@'localhost' (using password: YES)
(removed username but it's the right one)
How would I go about granting access to this user to create a file on the server?
Edit:
I changed the first line to be my exact home path, and received the same error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想要
GRANT
您的用户FILE
特权:要授予
FILE
权限,请以 root 身份登录并执行:You may want to
GRANT
your user theFILE
privilege:To grant the
FILE
privilege, log-in as root and execute: