Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Rsolved ERROR 1290 (HY000): INTO OUTFILE CSV FILE

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


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>


This post first appeared on Mysql Tech Tips, please read the originial post: here

Share the post

Rsolved ERROR 1290 (HY000): INTO OUTFILE CSV FILE

×

Subscribe to Mysql Tech Tips

Get updates delivered right to your inbox!

Thank you for your subscription

×