MySQL无法写入文件权限。

huangapple go评论116阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年7月10日 17:33:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76652461.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定