Linux using Mysqladmin extended-status with Linux commands to view MySQL running status
mysqladmin -uroot -ppassword -s /tmp/mysql_3306.sock -r -i 1 -c 10 ext |awk -f "|" "BEGIN{ COUNT=0; }" ' { if ($2 ~ /variable_name/ && ++count == 1) { print "----------|---------|----TRANSACTIONS----|--- mysql command status --|----- Innodb row operation ----|-- buffer pool read --"; print "---time---|---QPS---|commit rollback ~tps| select insert update delete| read inserted updated deleted| logical physical ";} else if ($2 ~ /queries/) {queries=$3;} else if ($2 ~ /com_commit /) {com_commit=$3;} else if ($2 ~ /com_rollback /) {com_rollback=$3;} else if ($2 ~ /com_select /) {com_select=$3;}else if ($2 ~ /com_insert /) {com_insert=$3;} else if ($2 ~ /com_update /) {com_update=$3;} else if ($2 ~ /com_delete /) {com_delete=$3;} else if ($2 ~ /innodb_rows_read/) {innodb_rows_read=$3;} else if ($2 ~ /innodb_rows_deleted/) {innodb_rows_deleted=$3;} else if ($2 ~ /innodb_rows_inserted/) {innodb_rows_inserted=$3;} else if ($2 ~ /innodb_rows_updated/) {innodb_rows_updated=$3;} else if ($2 ~ /innodb_buffer_pool_read_requests/) {innodb_lor=$3;} else if ($2 ~ /innodb_buffer_pool_reads/) {innodb_phr=$3;} else if ($2 ~ /uptime / && count >= 2) { printf (" %s |%9d", Strftime ("%h:%m:%s"), queries); printf ("|%6d %6d %6d", com_ Commit,com_rollback,com_commit+com_rollback); printf ("|%6d %6d %6d %6d", com_select,com_insert,com_update,com_delete); printf ("|%6d %8d %7d %7d", innodb_rows _read,innodb_rows_inserted,innodb_rows_updated,innodb_rows_deleted); printf ("|%10d %11d\n", INNODB_LOR,INNODB_PHR);}} '
According to Http://www.jb51.net/article/53900.htm finishing
The second edition reads as follows:
mysqladmin -uroot -psunyankui -s /tmp/mysql_3306.sock -r -i 1 -c 10 ext |awk -f "|" "BEGIN{ COUNT=0; }" ' { if ($2 ~ /variable_name/ && ++count == 1) { print "----------|---------|----TRANSACTIONS----|--- mysql command status --|----- Innodb row operation ----|-- buffer pool read --|-----Threads-----"; print "---time---|---QPS---|commit rollback ~tps|select insert update delete| read inserted updated deleted| logical physical|connected running ";} else if ($2 ~ /queries/) {queries=$3;} else if ($2 ~ /com_commit /) {com_commit=$3;} else if ($2 ~ /com_rollback /) {com_rollback=$3;} else if ($2 ~ /com_select /) {com_select=$3;} else if ($2 ~ /com_insert /) {com_insert=$3;} else if ($2 ~ /com_update /) {com_update=$3;} else if ($2 ~ /com_delete /) {com_delete=$3;} else if ($2 ~ /innodb_rows_read/) {innodb_rows_read=$3;} else if ($2 ~ /innodb_rows_deleted/) {innodb_rows_deleted=$3;} else if ($2 ~ /innodb_rows_inserted/) {innodb_rows_inserted=$3;} else if ($2 ~ /innodb_rows_updated/) {innodb_rows_updated=$3;} else if ($2 ~ /threads_connected /) {threads_connected=$3;} else if ($2 ~ /threads_running /) {threads_running=$3;} else if ($2 ~ /innodb_buffer_pool_read_requests/) {innodb_lor=$3;} else if ($2 ~ /innodb_buffer_pool_reads/) {innodb_phr=$3;} else if ($2 ~ /uptime / && count >= 2) { p rintf (" %s |%9d", Strftime ("%h:%m:%s"), queries), printf ("|%6d %6d %6d", Com_ Commit,com_rollback,com_commit+com_rollback); printf ("|%6d %6d %6d %6d", Com_select, Com_insert,com_update,com_delete); printf ("|%6d %8d %7d %7d", Innodb_rows_read,innodb _rows_inserted,innodb_rows_updated,innodb_rows_deleted); printf ("|%10d %11d", Innodb_lor,innodb _PHR); printf ("|%9d %7d\n", threads_connected,threads_running);} '
This article is from the "just out of the shell of the Birds" blog, please be sure to keep this source http://qhd2004.blog.51cto.com/629417/1827674
MySQL a script to check the running status