Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL set secure-file-priv to multiple directories

Tags:

mysql

Is there any way to allow MySQL to load data from multiple directories without setting secure-file-priv=''?

E.g., something like:

secure-file-priv="path/to/dir1","path/to/dir2"

From reading the docs, it isn't clear if multiple directories are allowed, and if so, how.

like image 204
dbc Avatar asked Oct 25 '16 19:10

dbc


People also ask

How do I fix priv secure file?

To overcome this error, you either need to remote the --secure-file-priv setting from your my. cnf file, or load your data from a directory specified in the value of the variable. Once you do so, your data should be loaded in without any issues!


1 Answers

The short answer is no. You can only set a single location for secure-file-priv.

That said, every sub-directory of the configuration can be written to.

If you wanted to write anywhere on the system then you would configure it like this:

[mysqld]
secure-file-priv="/"

It's important to note that any file created by into outfile is writable by all users.

like image 64
darronz Avatar answered Oct 13 '22 01:10

darronz