This might be due to AppArmor denying the MySQL server access to most of the filesystem. You can instead use
LOAD DATA LOCAL INFILE ...
to pipe data through the MySQL client, which can read everything the executing user can.
Do you need DevOps-experts?
Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!
We build reliable cloud solutions with Infrastructure as code