我正在尝试在 MySQL 数据库上运行以下命令:
SELECT * FROM mysql.db
INTO OUTFILE "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\db.csv"
FIELDS TERMINATED BY '|'
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
我得到错误:
SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
当我运行以下命令时:
mysql> SELECT @@secure_file_priv;
我得到:
+------------------------------------------------+
| @@secure_file_priv |
+------------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ |
+------------------------------------------------+
那么为什么即使我使用了 set --secure-file-priv 位置,它也不导出文件呢?
我习惯了 MSSQL 和 MySQL 新手。