我正在尝试从Mac上的终端使用mysql将数据库导出到csv文件中。 已从brew install安装了Mysql,版本是8.0.16。
以下我报告了代码和错误:
mysql> select *
-> from myTable
-> into OUTFILE 'Table.csv'
-> FIELDS TERMINATED BY ','
-> ENCLOSED BY '"'
-> LINES TERMINATED BY '\n';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-
priv option so it cannot execute this statement
mysql> show variables like "secure_file_priv";
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| secure_file_priv | NULL |
+------------------+-------+
1 row in set (0,01 sec)