英文:
MySQL cant write to file permission
问题
我在Ubuntu机器上运行MySQL 8,尝试执行以下查询:
SELECT * FROM test.t_test INTO OUTFILE "/data/mysql/uploads_mw_ebp/test.txt" CHARACTER SET UTF8;
但我一直收到以下错误:错误代码 1:无法写入文件'/data/mysql/uploads_mw_ebp/teste.txt'(OS errno 13 - 权限被拒绝)。
我已经为目录/data/mysql/uploads_mw_ebp/授予了完全权限(777),并且mysql用户具有完全权限(包括File权限)。
之前的目录与secure-file-priv配置相同。
为什么我一直收到权限被拒绝的错误?
英文:
I have MySQL 8 running on a Ubuntu machine and im trying to execute the following query:
SELECT * FROM test.t_test INTO OUTFILE "/data/mysql/uploads_mw_ebp/test.txt" CHARACTER SET UTF8;
but I keep getting the following error: Error Code 1: Can´t write to file '/data/mysql/uploads_mw_ebp/teste.txt' (OS errno 13 - Permission denied).
I have gave full permissions (777) to the directory /data/mysql/uploads_mw_ebp/ and the mysql user has full privileges (including File privileges).
The previous directory is the same that is configured for secure-file-priv.
Why I keep getting permission denied?
答案1
得分: 1
Apparmor在Debian/Ubuntu上(在RedHat或类似的发行版上是SELinux)通常也会限制这些访问权限。您可以尝试编辑配置文件,进行测试,也可以临时禁用它。
英文:
Apparmor on Debian/Ubuntu (SELinux on RedHat or similar distros) often limit these accesses too.
You can try to edit the profile or to test, you can also temporary disable it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论