Background: I am running a cqpweb, a corpus query interface written in PHP and connected to a mysql database, on an Apache2 webserver under Ubuntu 18.04 LTS. The Ubuntu server was set up from scratch and there are currently no manual configurations to mysql or php.
cqpweb ran happily unless it started throwing out error messages like this one:
A MySQL query did not run successfully! Original query: LOAD DATA LOCAL INFILE '/data2/cqpweb/cach/tab_dist_fycel9oplk' INTO TABLE `db_dist_g2f3ndxf40` FIELDS ESCAPED BY '' /* from User: knappen | Function: create_db() | 2019-Apr-25 11:23:01 */ Error # 0:
This happened overnight, no updates or other changes to the system occurred except for a grace restart of the Apache http server by a daily cron job.
The very strange thing is that when I log into the mysql database using the same database user as the webserver and cut&paste the query into mysql, it works. The difference is only the UNIX user: In case of the webserver, the user www-data, in case of the login me (as a normal user not using my sudo priviledge).
Question Is mysql sensitive to the UNIX user before the login, and if yes, what does influence the behaviour of mysql here (some environment variables?)? Is there a difference between interactive and non-interactive?
Related question with other aspacts of the same underlying problem:
EDIT: Excluded AppArmor as a potential culprit, disabling AppArmor and restarting Apache2 does not change the behaviour.
EDIT2: The user is question has
mysql_native_password as plugin, not