G
G
Gennady2020-04-29 12:02:21
MySQL
Gennady, 2020-04-29 12:02:21

Can't create/write to file - MYSQL to a directory other than /var/tmp. Why does it give an error?

Server version : 5.7.29-0ubuntu0.18.04.1 (Ubuntu)

Trying to save the output to /var/www/dir/file.csv

Can't create/write to file '/var/www/dir/file.csv' (Errcode: 13 - Permission denied)


The script and request are launched through a php script in the browser.

Permissions on the /dir/ folder ( ls -al)

drwxrwxrwx 2 mysql root 4096 Apr 29 10:40 dir

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gennady, 2020-04-29
@theblackpost

This is of course not quite an answer to the question, but:
I checked that by default, mysql is allowed to write to : And rewrote the paths in the php script to this directory. /var/lib/mysql-files/
SHOW VARIABLES LIKE "secure_file_priv";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question