一、mysql查询qps脚本
调用:./mysql_qps.sh 127.0.0.1 3306 root password
#!/bin/bash
[ $# -lt 3 ] && {
echo "usage: command host port user [password]"
exit
}
if [ $# -eq 3 ];then
connection="mysql -h$1 -P $2 -u$3"
else
connection="mysql -h$1 -P $2 -u$3 -p$4"
fi
query() {
$connection <
show global status where variable_name='Com_insert';
show global status where variable_name='Com_select';
show global status where variable_name='Com_update';
show global status where variable_name='Com_replace';
show global status where variable_name='Com_delete';
#show global status where variable_name='Com_drop_db';
#show global status where variable_name='Co