MySQL throws this error for two reasons, either there is no directory specified under the --secure--file--priv variable, or we are importing or exporting Wrong path data was given in the query. To resolve this error we have to check the value of –secure_file_priv variable by following query-
mysql> Select @@global.secure_file_priv; +---------------------------+ | @@global.secure_file_priv | +---------------------------+ | C:\mysql\bin\mysql-files\ | +---------------------------+ 1 row in set (0.00 sec)
We can see there is a path under secure_file_priv variable and when we export data all the files will be there Created in the directory.
However, if the above command shows the result as NULL, then it means that the path is not specified and we need to specify the path in the my.ini file before exporting the data. Suppose if we write secure_file_priv = mysql-files/ in my.ini file, then the value of secure_file_priv will be similar to above. All files will then be created in this directory.
The above is the detailed content of How can we resolve the MySQL error 'ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option and therefore cannot execute this statement' while importing or exporting data?. For more information, please follow other related articles on the PHP Chinese website!