Home > Database > Mysql Tutorial > 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?

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?

WBOY
Release: 2023-08-27 10:17:05
forward
848 people have browsed it

在导入或导出数据时,我们如何解决 MySQL 错误“ERROR 1290 (HY000):MySQL 服务器正在使用 --secure-file-priv 选项运行,因此无法执行此语句”?

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template