I cannot find where to set secure-file-priv
. I get this message:
1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
when running this statement:
SELECT COLUMN_NAME, data_type FROM tabledefs INTO OUTFILE 'xpeter'
If I remove OUTFILE 'xpeter'
it works. OUTFILE '/tmp/xpeter
does not work either.
I tried to add --secure-file-priv="/tmp"
, no change. Variable stays as NULL:
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" --secure-file-priv="/tmp" $other_args >/dev/null &
/usr/local/mysql/bin/mysqld --verbose --help | grep secure-file
--secure-file-priv=name
secure-file-priv NULL
There is no my.cnf
file. I run through whole filesystem, looking for any *.cnf
file. Could not find any other than: ./mysql-5.7.17-macos10.12-x86_64/data/auto.cnf
and ./mysql-5.7.17-macos10.12-x86_64/support-files/my-default.cnf
. The line $bindir/mysqld...
is in support-files/my-default.cnf
.
I rerun the query without OUTFILE 'xpeter'
, query OK, no messages in log files except apache2 log
. Then I run
SELECT COLUMN_NAME, data_type INTO OUTFILE 'xpeter' FROM tabledefs
no errors in logfiles, only in phpmyadmin (where I run the query statement from, logged in as root): same message as before.
I tried the etc/my.cnf
and also:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ProgramArguments</key>
<array>
<string>--secure-file-priv=/mysql_exp</string>
</array>
<key>WorkingDirectory</key> <string>/usr/local/mysql</string>
</dict>
</plist>
In both cases after reboot I was still not allowed to write a file.
I did not change the folder owner. If I add --secure-file-priv=/mysql_exp
to Daemons and reboot MySQL does not run at all.