[MySQL] 상태가 sleep 인것 정리하기
#!/bin/sh NOW=$(date +"%m-%d-%Y") FILE="/root/sleep_processes.$NOW.txt" /var/lib/mysql-5.1.40/bin/mysql -uroot --password='password' -e "select concat('KILL ',id,';') into outfile '/tmp/sleep_processes.txt' from information_schema.processlist where State = 'User sleep'" /var/lib/mysql-5.1.40/bin/mysql -uroot --password='password' -e "source /tmp/sleep_processes.txt;" if [ -s "/tmp/sleep_processes.txt" ]; then cp /tmp/sleep_processes.txt $FILE fi rm -f /tmp/sleep_processes.txt https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=81951&page=2