0

I'm running MariaDB on Debian 9.5. I've done the following in the Debian shell:

mkdir /home/db_out_test
chown mysql:mysql /home/db_out_test
mkdir /var/db_out_test
chown mysql:mysql /var/db_out_test

Then I log in to MariaDB and run the following commands in the MariaDB shell:

select * from database.table into outfile "/var/db_out_test/test.csv";
select * from database.table into outfile "/home/db_out_test/test.csv";

The one in /var/ works. For the second one in home, however, I get

ERROR 1 (HY000): Can't create/write to file '/home/db_out_test/test.csv' (Errcode: 13 "Permission denied")

Apparmor is not active. This is a relatively recent release of MariaDB, where the apparmor file explicitly states it's left empty by default to disable apparmor. I'm losing my mind here.

Logan Jones
  • 161
  • 5
  • If you do something like `sudo -u mysql bash -c 'cd /home/db_out_test && ls -al'` do you get errors? What errors? – Zoredache Aug 23 '18 at 22:54
  • No error. It lists the contents. I was also able to `sudo -u mysql bash -c 'touch /home/db_out_test/touchtest'`and successfully create the touchtest file. – Logan Jones Aug 27 '18 at 20:02
  • Hrm, if you get no errors with that command, and the touch command you listed I would expect things to just work. I am not sure what the problem could be. I would probably try running strace and watch the mariadb process though the verbosity of that can often make seeing the issue pretty difficult. – Zoredache Aug 27 '18 at 20:36

0 Answers0