mysql -uroot -p -e "use database_name;select * from table_name " > a.txt # 双引号里是具体的sql # a.txt 为要导出的文件名