http://blog.csdn.net/peopleqinlei/article/details/50978474
mysql -e "source batch-file"
mysql -uroot -pxxx -s -e "select * from xxx.xxx;"
mysql -uroot -pmysqluser -vv -s -e "select * from xxx.xxxlimit 30;"
mysql --help
...
-e, --execute=name Execute command and quit. (Disables --force and history
file.)
-s, --silent Be more silent. Print results with a tab as separator,
each row on new line.
...
###或者使用shell脚本更容易执行
#!/usr/bin/env bash
while true
do
mysql -uroot -pxxx -s -e "select * from xxx.xxx;"
sleep 1
done