Depends on where you want the file exported. Say that you want the file exported to the same machine that mysql is running on, MySQL has a SELECT * INTO OUTFILE syntax.
See http://dev.mysql.com/doc/mysql/en/SELECT.html for more.
SELECT field1, field2, field3
INTO OUTFILE '/tmp/file.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
If you want the file to be exported into a client machine (and mysql is running on a separate server), then you might want to use Delphi to open a database connection and retrieve the data. Then, you can use regular Delphi file functions (or TStringList or even the ADO components) to write out a CSV file.