mytop 是一個類似 Linux 下的 top 命令風格的 MySQL 監控工具,可以監控當前的連接用戶和正在執行的命令。
1. 安裝TermReadKey 下載地址:http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz 安裝: tar xzvf TermReadKey cd TermReadKey perl Makefile.pl make make test make install
2. 安裝DBI 下載地址:http://cpan.uwinnipeg.ca/dist/DBI 安裝: tar xzvf DBI-1.615.tar.gz cd DBI-1.615 perl Makefile.pl make make test make install
3. 安裝Mytop 下載地址:http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz 安裝: tar xzvf mytop-1.6.tar.gz cd mytop-1.6 perl Makefile.pl make make test make install
4.執行 mytop -uroot -pxxxxx 可能會出現報錯: MySQL on localhost (5.1.43-log) up 345+20:36:31 [09:07:11] Queries: 3.0 qps: 0 Slow: 0.0 Se/In/Up/De(%): 00/00/00/00
Key Efficiency: 100.0% Bps in/out: 0.0/ 0.0
Id User Host/IP DB Time Cmd Query or State -- ---- ------- -- ---- --- ---------- Use of uninitialized value in substitution (s///) at ./mytop line 955. Use of uninitialized value in substitution (s///) at ./mytop line 955. ................................................... Use of uninitialized value in substitution (s///) at ./mytop line 955.