Ok, so, I have the same issue since some lib udpate (it was working like a charm before that), and so, I've tried everything I found:
- move csv file to /tmp
- try the 'local' param
- chmod to 777 the csv
- chown the csv to mysql:mysql
- check the apparmor conf (was already good)
But none of this work until I found this post (https://bbs.archlinux.org/viewtopic.php?id=227181) which I copy below for future reference (and in case the original post disappear)
The issue is that a recent change in MariaDB systemd service file prevents any file access from /home, /root, /run/user, and /tmp:
# Prevent accessing /home, /root and /run/user
ProtectHome=true
access to /tmp is restricted elsewhere in the service file. For the sake of someone else running into this issue, here are the necessary steps to allow file access from /home. Note that even if your service file is called mysqld.service (as mine is), you still want to name the folder for the supplementary service files mariadb.service.d (or it won't work).
# mkdir /etc/systemd/system/mariadb.service.d
# cd /etc/systemd/system/mariadb.service.d
- created a file called, say load_data.conf, and enter the following lines in the file:
[Service]
# Override default directive with prevents accessing /home, /root and /run/user
ProtectHome=false
# systemctl daemon-reload
# systemctl restart mysqld
This is all documented here; https://mariadb.com/kb/en/mariadb/systemd/
(You just need to know where to look.)