ERROR 1290 ao exportar para .csv
1 2 3 4 5 6 7 |
mysql> SELECT * FROM alunos INTO OUTFILE '/tmp/alunos.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ';' ESCAPED BY '"' LINES TERMINATED BY '\r\n'; ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement |
Edite o arquivo /etc/my.cnf
Adicione a linha
1 |
secure-file-priv = "" |
Exportando novamente
1 2 3 4 5 6 7 |
mysql> SELECT * FROM alunos -> INTO OUTFILE '/tmp/alunos.csv' -> FIELDS ENCLOSED BY '"' -> TERMINATED BY ';' -> ESCAPED BY '"' -> LINES TERMINATED BY '\r\n'; Query OK, 8000 rows affected (0.00 sec |
Resolvido!