mytop 是一個(gè)類(lèi)似 Linux 下的 top 命令風(fēng)格的 MySQL 監(jiān)控工具,可以監(jiān)控當(dāng)前的連接用戶(hù)和正在執(zhí)行的命令。
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.執(zhí)行 mytop -uroot -pxxxxx 可能會(huì)出現(xiàn)報(bào)錯(cuò): 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.