I am having some problems with the permissions with the instruction SELECT ... INTO OUTFILE.
When entering my database and executing a simple export command, for example:
mysql> select * from XYZ into outfile '/home/mropa/Photos/Desktop/TEST.txt';
I get the answer:
ERROR 1 (HY000):
Can't create/write to file '/home/mropa/Photos/Desktop/TEST.txt'
(Errcode: 13)
However, when I just write:
mysql> select * from XYZ into outfile 'TEST.txt';
Query OK, 8287 rows affected (0.73 sec)
The file is written to the directory /var/lib/mysql/XYZ. I looked at the file /etc/apparmor.d/usr.sbin.mysqldwhere mysql seems to determine read and write permissions, but I really don't know how to change it.
How do I allow my mysql table to be exported to any directory that I like?
mropa source
share