How to disable secure-file-priv MySQL Ubuntu

The mysql documentation on secure_file_priv states that the variable is set to a default, platform-specific filesystem location, to make it secure by default.

That said, you need to explicitly set the variable to an empty string in your configuration to disable this security feature.

For Ubuntu, edit the file /etc/mysql/mysql.conf.d/mysqld.cnf and add the following line at the end:

secure_file_priv=""

Then make sure to restart the service.


For me adding to the end of the above file didn't work.

I added it to the /etc/mysql/my.cnf file in the [mysqld] section and it worked.

You may be able to create that section in the above file and it also work, I didn't test it.

After the server re-start you can test with SHOW VARIABLES LIKE "secure_file_priv"; provided you have priveleve to do so.

Tags:

Mysql

Ubuntu