Rsolved ERROR 1290 (HY000): INTO OUTFILE CSV FILE
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Find out where you are allowed to write
mysql> SELECT @@GLOBAL.secure_file_priv;
+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| NULL |
+---------------------------+
1 row in set (0.00 sec)
Enable read/write for MySQL installed
stop mysql Server
vi my.cnf
[mysqld_safe]
[mysqld]
secure_file_priv="/tmp/"
start mysql
Log in mysql
mysql> SELECT @@GLOBAL.secure_file_priv;
+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| /tmp/ |
+---------------------------+
1 row in set (0.00 sec)
Finally exporting into a CSV file
mysql> SELECT * FROM testeble INTO OUTFILE '/tmp/test.csv' FIELDS TERMINATED BY ',';
Query OK, 9901 rows affected (1.65 sec)
mysql>