How to run mysql query in shell script February 2, 2012 by kary Following script can select data from MySQL and save to CSV. $mysql_bin -u xxx -pxxx dbname