Monday, 18 July 2016

Watch queries being executed in MySQL

better than innotop or mysqltop:


while sleep 0.2; do 
  QUERY=$(mysql -u dbuser -p******* dbname -e 'show processlist;' | grep -v "NULL\|User"); 
  if [ "$QUERY" ] ; then 
    echo "$(date +%s)${QUERY}"; 
  fi; 
done

No comments:

Post a Comment