mysql 使用show process自動記錄
1.秀出 PROCESS的SHELL
存檔檔名為:show_processlist.sh
#!/bin/bash
mysql -u root -p'password'<<EOFMYSQL
show processlist;
EOFMYSQL
2.將結果存檔的 SHELL
#!/bin/bash
#for((;;))
#do
echo "-------------------------" >> /var/log/msyql_process.txt
date >> /home/linkliu/msyql_process.txt
/var/log/show_processlist.sh >> /var/log/msyql_process.txt
#done