# cpan
# cpan > install DBI
# cpan > install Term::ReadKey
# cpan > install DBD::mysql
# cpan > exit
cd ~
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar xzf mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make
make install
# cpan > install DBI
# cpan > install Term::ReadKey
# cpan > install DBD::mysql
# cpan > exit
cd ~
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar xzf mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make
make install
用法: ./mytop -u root -p 123456 -d test
如果出现Use of uninitialized value in substitution (s///) at ./mytop line 955.则vi mytop
跳到955行,找到
$host =~ s/^([^.]+).*/$1/;
$thread->{Host} = $host;
改为:
if ($host)
{
$host =~ s/^([^.]+).*/$1/;
$thread->{Host} = $host;
}