MySQL export to CSV
MySQL allows you to export a query directly in to a CSV file that can be opened by Microsoft Excel.
This is the basic syntax:
select fields from table into outfile '/path/to/file_name.csv' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n';
The export file that is created “file_name.csv” must not already exist, the MySQL user must have write permissions to the directory the file will be created in, and the FILE permission within MySQL.
See the MySQL manual: SELECT Syntax