[MySQL FAQ]系列 -- Linux命令行下快速监控mysql

作/译者:叶金荣(Email: ),来源:http://imysql.cn,转载请注明作/译者和出处,并且不能用于商业用途,违者必究。
其实很简单,就是利用linux下的 watch 工具来做监控,方法如下:
[yejr@localhost imysql]# watch -d -n 10 "egrep 'MySQL thread|Log|Modified db pages' innodb_status.3249 "     
Every 10.0s: egrep 'MySQL thread|Log|Modified db pages' innodb_status.3249                                               Thu Apr  9 10:01:12 2009
MySQL thread id 6, query id 71 localhost root Sending data
Log sequence number 2703 3443241402
Log flushed up to   2703 3442763607
Modified db pages       83325
或者:
[yejr@localhost imysql]#watch -d -n 10 "mysqladmin ext|egrep Innodb_data"    
Every 10.0s: mysqladmin ext|egrep Innodb_data                                                                             Thu Apr  9 10:03:55 2009
| Innodb_data_fsyncs                | 4144699     |
| Innodb_data_pending_fsyncs        | 0           |
| Innodb_data_pending_reads         | 0           |
| Innodb_data_pending_writes        | 0           |
| Innodb_data_read                  | 5567172608  |
| Innodb_data_reads                 | 298413      |
| Innodb_data_writes                | 4492881     |
| Innodb_data_written               | 18549422080 |
参数解释:
-d --differences
-n --interval
不用我多说了吧,怎么样,是不是觉得很有意思呢 :)
本文出自 “MySQL中文网”博客 http://www.imysql.cn/

本文出自 “爱MySQL” 博客,转载请与作者联系!

你可能感兴趣的:(linux,mysql,数据库,FAQ,命令)