Mysql: Export select rows to CSV on server

Use the following command to export the query rows to a file on the server in the CSV format:

Source:

http://stackoverflow.com/questions/356578/how-to-output-mysql-query-results-in-csv-format