If, like myself, you often use the excellent phpmyadmin opensource software to access your mysql server, here is a quick way you can export the results of a mysql query into common formats like CSV, sql, zip using the phpmyadmin interface.
In phpmyadmin run your query. Once you are presented with the query results, scroll down to the bottom of the screen. Click the bottom-most “Export” link.
Once you click the “Export” link you will be presented with a screen where you can specify further details about your export. While there, you can specify the format of your export and even restrict the data to be exported by range and size of overall data file.
Click the “Go” button to complete the operation and finish the data export.