How do I set a value for secure_file_priv
?
I found this which tells what settings may be used https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_secure_file_priv
The mysql server starts without any command line options. There is nothing to override its' .cnf file.
user@server:~$ ps aux | grep [m]ysql
mysql 4495 0.0 7.0 544368 144924 ? Ssl 09:16 0:02 /usr/sbin/mysqld
Running :~$ mysqld --verbose --help
tells me
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
Only the 2nd file exists. It is the beginning of a symlink chain to
/etc/mysql/my.cnf.migrated
as follows...
user@server:~$ ls -l /etc/mysql/my.cnf
lrwxrwxrwx 1 root root 24 Aug 12 15:15 /etc/mysql/my.cnf -> /etc/alternatives/my.cnf
user@server:~$ ls -l /etc/alternatives/my.cnf
lrwxrwxrwx 1 root root 26 Aug 12 15:15 /etc/alternatives/my.cnf -> /etc/mysql/my.cnf.migrated
user@server:~$ ls -l /etc/mysql/my.cnf.migrated
-rw-r--r-- 1 root root 4455 Dec 13 03:18 /etc/mysql/my.cnf.migrated
I've tried setting values for secure_file_priv
in that last file, restarting the mysql server and even rebooting the Ubuntu server. No matter the value that is set the command
mysql> SELECT @@GLOBAL.secure_file_priv;
always returns /var/lib/mysql-files/
.
I've also searched for other .cnf files and tried setting the value for secure_file_priv
in each of them
user@server:~$ find /etc -iname "m*.cn*" -type f
/etc/mysql/conf.d/mysql.cnf
/etc/mysql/my.cnf.migrated
/etc/mysql/my.cnf.fallback
/etc/mysql/mysql.conf.d/mysqld.cnf
/etc/mysql/mysql.cnf
No matter. After making a change, restarting the server, and checking the value with
mysql> SELECT @@GLOBAL.secure_file_priv;
the result /var/lib/mysql-files/
is always the same. It doesn't change.
What do I need to do to set a value for secure_file_priv
?