最近研究了下mysql的监控工具mytop,也在网络上搜罗了很久,按照他们的流程总是安装不成功,也许是环境不一样的原因吧。在安装的过程中遇到很多问题,美国服务器,网站空间,迟迟不能解决,但是,在经过一番努力之后终于安装成功了,现在加以详细汇总,以备将来使用,同时也可以给各位博友提供一份参考,将我个人的安装过程贴出来,仅供参考,如有疑问请联系qq:349871740,欢迎指正^_^
1、os版本:red hat enterprise linux server release 5.3
mysql版本:4.0.26
2、安装文件列表:
mysql-shared-compat-5.1.57-1.rhel5.i386.rpm
mytop-1.6.tar.gz
perl-dbd-mysql-3.0007-2.el5.i386.rpm
perl-dbi-1.52-2.el5.i386.rpm
termreadkey-2.30.tar.gz
3、相关文件下载链接:
wget
wget
wget ftp://mirror.switch.ch/pool/1/mirror/mysql/downloads/mysql-5.1/mysql-shared-compat-5.1.57-1.rhel5.i386.rpm
wget ftp://ftp.icm.edu.pl/vol/rzm2/linux-slc/slc54/i386/sl/perl-dbd-mysql-3.0007-2.el5.i386.rpm
wget ftp://ftp.icm.edu.pl/vol/rzm2/linux-slc/slc58/i386/sl/perl-dbi-1.52-2.el5.i386.rpm
4、安装流程如下:
[root@tech tmp]# tar zxvf termreadkey-2.30.tar.gz && cd termreadkey-2.30
[root@tech termreadkey-2.30]# perl makefile.pl && make && make install
[root@tech termreadkey-2.30]# cd ..
[root@tech tmp]# rpm -uvh mysql-shared-compat-5.1.57-1.rhel5.i386.rpm perl-dbd-mysql-3.0007-2.el5.i386.rpm perl-dbi-1.52-2.el5.i386.rpm
[root@tech tmp]# tar zxvf mytop-1.6.tar.gz && cd mytop-1.6
[root@tech mytop-1.6]# perl makefile.pl && make && make install
5、配置mytop并运行
[root@tech mytop-1.6]# mytop
cannot connect to mysql server. please check the:
* database you specified test (default is test)
* username you specified root (default is root)
* password you specified (default is )
* hostname you specified localhost (default is localhost)
* port you specified 3306 (default is 3306)
* socket you specified (default is )
the options my be specified on the command-line or in a ~/.mytop
config file. see the manual (perldoc mytop) for details.
here's the exact error from dbi. it might help you debug:
can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock' (2)
[root@tech mytop-1.6]# cat /root/.mytop
> user=root
> pass=123456
> host=127.0.0.1
> db=cacti
> delay=10
> port=3306
> resolve=0
> socket=/tmp/mysql.sock
> eof
[root@tech mytop-1.6]# mytop
6、更详细的参数选项请参考man手册,服务器空间,这里不再赘述。
[root@tech mytop-1.6]# man mytop
7、以下是我的安装和配置过程:
[root@tech ~]# uname -a
linux tech 2.6.18-128.el5pae #1 smp wed dec 17 12:02:33 est 2008 i686 i686 i386 gnu/linux
[root@tech ~]# lsb_release -a
lsb version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
distributor id: redhatenterpriseserver
description: red hat enterprise linux server release 5.3 (tikanga)
release: 5.3
codename: tikanga
[root@tech ~]# cat /etc/issue
red hat enterprise linux server release 5.3 (tikanga)
kernel \r on an \m
[root@tech ~]# cd /tmp
[root@tech tmp]# ll
total 6144
-rw-r--r-- 1 root root 5443408 mar 24 19:17 mysql-shared-compat-5.1.57-1.rhel5.i386.rpm
-rw-r--r-- 1 root root 19720 mar 24 18:39 mytop-1.6.tar.gz
-rw-r--r-- 1 root root 150649 oct 16 2008 perl-dbd-mysql-3.0007-2.el5.i386.rpm
-rw-r--r-- 1 root root 613929 mar 24 19:06 perl-dbi-1.52-2.el5.i386.rpm
-rw-r--r-- 1 root root 37006 jun 13 10:56 termreadkey-2.30.tar.gz
-rw-r--r-- 1 root root 0 jun 16 14:42 typescript
[root@tech tmp]# tar zxvf termreadkey-2.30.tar.gz && cd termreadkey-2.30
termreadkey-2.30/
termreadkey-2.30/genchars.pl
termreadkey-2.30/makefile.pl
termreadkey-2.30/configure.pm
termreadkey-2.30/test.pl
termreadkey-2.30/readkey.pm
termreadkey-2.30/meta.yml
termreadkey-2.30/readkey.xs
termreadkey-2.30/ppport.h
termreadkey-2.30/manifest
termreadkey-2.30/readme
[root@tech termreadkey-2.30]# perl makefile.pl && make && make install
checking if your kit is complete...
looks good
writing makefile for term::readkey
cp readkey.pm blib/lib/term/readkey.pm
autosplitting blib/lib/term/readkey.pm (blib/lib/auto/term/readkey)
/usr/bin/perl -i/usr/lib/perl5/5.8.8 genchars.pl
writing termio/termios section of cchars.h... done.
checking for sgtty...
sgtty not found.
writing sgtty section of cchars.h... done.
/usr/bin/perl /usr/lib/perl5/5.8.8/extutils/xsubpp -noprototypes -typemap /usr/lib/perl5/5.8.8/extutils/typemap readkey.xs > readkey.xsc && mv readkey.xsc readkey.c
gcc -c -d_reentrant -d_gnu_source -fno-strict-aliasing -pipe -wdeclaration-after-statement -i/usr/local/include -d_largefile_source -d_file_offset_bits=64 -i/usr/include/gdbm -o2 -g -pipe -wall -wp,-d_fortify_source=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -dversion=\2.30\ -dxs_version=\2.30\ -fpic -i/usr/lib/perl5/5.8.8/i386-linux-thread-multi/core readkey.c
in file included from readkey.xs:6:
ppport.h:230:1: warning: perl_unused_decl redefined
in file included from readkey.xs:4:
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/core/perl.h:163:1: warning: this is the location of the previous definition
in file included from readkey.xs:375:
cchars.h: in function 'xs_term__readkey_getcontrolchars':
cchars.h:244: warning: unused variable 'i'
readkey.xs: in function 'readmode':
readkey.xs:770: warning: unused variable 'perl___notused'
readkey.c: in function 'xs_term__readkey_setterminalsize':
readkey.c:1999: warning: unused variable 'targ'
running mkbootstrap for term::readkey ()
chmod 644 readkey.bs
rm -f blib/arch/auto/term/readkey/readkey.so
gcc -shared -o2 -g -pipe -wall -wp,-d_fortify_source=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -l/usr/local/lib readkey.o -o blib/arch/auto/term/readkey/readkey.so \
\
chmod 755 blib/arch/auto/term/readkey/readkey.so
cp readkey.bs blib/arch/auto/term/readkey/readkey.bs
chmod 644 blib/arch/auto/term/readkey/readkey.bs
manifying blib/man3/term::readkey.3pm
installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/term/readkey/readkey.bs
installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/term/readkey/readkey.so
files found in blib/arch: installing files in blib/lib into architecture dependent library tree
installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/term/readkey/autosplit.ix
installing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/term/readkey.pm
installing /usr/share/man/man3/term::readkey.3pm
writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/term/readkey/.packlist
appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
[root@tech termreadkey-2.30]# cd ..
[root@tech tmp]# rpm -uvh mysql-shared-compat-5.1.57-1.rhel5.i386.rpm perl-dbd-mysql-3.0007-2.el5.i386.rpm perl-dbi-1.52-2.el5.i386.rpm
warning: perl-dbd-mysql-3.0007-2.el5.i386.rpm: header v3 dsa signature: nokey, key id 37017186
warning: perl-dbi-1.52-2.el5.i386.rpm: header v3 dsa signature: nokey, key id e8562897
preparing... ########################################### [100%]
1:perl-dbi ########################################### [ 33%]
2:mysql-shared-compat ########################################### [ 67%]
3:perl-dbd-mysql ########################################### [100%]
[root@tech tmp]# tar zxvf mytop-1.6.tar.gz && cd mytop-1.6
mytop-1.6/
mytop-1.6/manifest
mytop-1.6/test.pl
mytop-1.6/mytop
mytop-1.6/changes
mytop-1.6/install
mytop-1.6/readme
mytop-1.6/makefile.pl
mytop-1.6/meta.yml
[root@tech mytop-1.6]# perl makefile.pl && make && make install
checking if your kit is complete...
looks good
writing makefile for mytop
cp mytop blib/script/mytop
/usr/bin/perl -mextutils::my -e my->fixin(shift) blib/script/mytop
manifying blib/man1/mytop.1
installing /usr/share/man/man1/mytop.1
installing /usr/bin/mytop
writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/mytop/.packlist
appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
[root@tech mytop-1.6]# mytop
cannot connect to mysql server. please check the:
