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.