guarda collega
devi solo aggiungerlo alla query
select * from table INTO OUTFILE '/tmp/myfilename.txt'
puoi migliorarlo in file csv (usandolo in excel quest'ultimo)
come :
INTO OUTFILE '/tmp/myfilename.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'