首页 数据库 mysql教程 mytop-MySQL监控工具

mytop-MySQL监控工具

Jun 07, 2016 pm 05:40 PM
工具 监控

最近研究了下MySQL的监控工具mytop,也在网络上搜罗了很久,按照他们的流程总是安装不成功,也许是环境不一样的原因吧。在安装的过程中遇到很多问题,迟迟不能解

最近研究了下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:

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
1 个月前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

如何用PHP的cURL库发送包含JSON数据的POST请求? 如何用PHP的cURL库发送包含JSON数据的POST请求? Apr 01, 2025 pm 03:12 PM

使用PHP的cURL库发送JSON数据在PHP开发中,经常需要与外部API进行交互,其中一种常见的方式是使用cURL库发送POST�...

如何在LAMP架构下高效整合Node.js或Python服务? 如何在LAMP架构下高效整合Node.js或Python服务? Apr 01, 2025 pm 02:48 PM

在LAMP架构下整合Node.js或Python服务许多网站开发者都面临这样的问题:已有的LAMP(Linux Apache MySQL PHP)架构网站需要...

如何在macOS上将apscheduler定时任务配置为服务? 如何在macOS上将apscheduler定时任务配置为服务? Apr 01, 2025 pm 06:09 PM

在macOS上将apscheduler定时任务配置为服务在macOS平台上,如果你想将apscheduler定时任务配置为一个服务,类似于ngin...

Python参数注解可以使用字符串吗? Python参数注解可以使用字符串吗? Apr 01, 2025 pm 08:39 PM

Python参数注解的另类用法在Python编程中,参数注解是一种非常有用的功能,可以帮助开发者更好地理解和使用函...

MongoDB在Debian上的高可用性如何保障 MongoDB在Debian上的高可用性如何保障 Apr 02, 2025 am 07:21 AM

本文介绍如何在Debian系统上构建高可用性的MongoDB数据库。我们将探讨多种方法,确保数据安全和服务持续运行。关键策略:副本集(ReplicaSet):利用副本集实现数据冗余和自动故障转移。当主节点出现故障时,副本集会自动选举新的主节点,保证服务的持续可用性。数据备份与恢复:定期使用mongodump命令进行数据库备份,并制定有效的恢复策略,以应对数据丢失风险。监控与报警:部署监控工具(如Prometheus、Grafana)实时监控MongoDB的运行状态,并

在 LangChain 中,如何使用 AgentExecutor 替代已被禁用的 initialize_agent 函数? 在 LangChain 中,如何使用 AgentExecutor 替代已被禁用的 initialize_agent 函数? Apr 01, 2025 pm 04:18 PM

在LangChain中,如何替代已被禁用的initialize_agent函数?在LangChain库中,initialize_agent...

如何在10小时内通过项目和问题驱动的方式教计算机小白编程基础? 如何在10小时内通过项目和问题驱动的方式教计算机小白编程基础? Apr 02, 2025 am 07:18 AM

如何在10小时内教计算机小白编程基础?如果你只有10个小时来教计算机小白一些编程知识,你会选择教些什么�...

Linux系统自带Python解释器能删除吗? Linux系统自带Python解释器能删除吗? Apr 02, 2025 am 07:00 AM

关于Linux系统自带Python解释器的删除问题许多Linux发行版在安装时会预装Python解释器,它并非通过软件包管理器�...

See all articles