mysql


 mysql -h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} -e "sql语句"
 
 -hlocalhost -uroot -proot customer -e "select * from customer" > 1.txt


参考文章:

http://www.2cto.com/database/201410/343557.html



shell编程—— EOF  

 http://blog.163.com/njut_wangjian/blog/static/1657964252013112152418345/