Jesse wrote:
Is there a way to export results of a query to a file? In other words, if I do a "select * from somefile", is there a phrase like "send output to somefile.txt", or something? I've searched the help file, and I guess I don't know what I'm looking for, if it even exists. I'm using MySQL version 5

You can use SELECT INTO OUTFILE:

The SELECT ... INTO OUTFILE 'file_name' form of SELECT writes the selected rows to a file

See:

http://dev.mysql.com/doc/refman/5.0/en/select.html for more details. Alternatively, you can run mysql command line client with the 'e' flag and redirect standard output to a file:

mysql -e 'SELECT * FROM test;' > sql_output

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to