【发布时间】:2021-09-25 07:11:13
【问题描述】:
我必须将我的SQL 查询输出保存在一个文本文件中。当我运行所需的查询时:
mysql -u root -p nextcloud -e "select * from oc_share INTO OUTFILE '/root/sql/test.txt'"
..它会抛出这个错误:
ERROR 1 (HY000) at line 1: Can't create/write to file '/root/sql/test.txt' (Errcode: 13 "Permission denied")
为什么会这样。我正在使用 Ubuntu 20.04。
【问题讨论】:
-
需要更多信息。您使用什么程序运行查询?什么版本?等谢谢。
-
请分享更多细节。 MySQL进程是否有写入
/root的权限?