3 steps to export Mysql to file via command line.
1. Export Mysql to file from GUI, http://www.withdata.com/mytotxt/unload.html.
2. Save session, http://www.withdata.com/mytotxt/session.html.
3. Repeat session in command line, http://www.withdata.com/mytotxt/cmd.html.
MyToTxt is a data conversion tool that helps you export Mysql data to file (csv, txt, sql, xml, html, Excel).