search
HomeDatabaseMysql Tutorial mytop-MySQL监控工具

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

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何在FastAPI中实现请求日志记录和监控如何在FastAPI中实现请求日志记录和监控Jul 30, 2023 am 08:29 AM

如何在FastAPI中实现请求日志记录和监控引言:FastAPI是一个基于Python3.7+的高性能Web框架,它提供了许多强大的功能和特性,包括自动化的请求和响应模型验证、安全性、性能优化等。在实际开发中,我们经常需要在应用程序中记录请求日志以便进行排错和监控分析。本文将介绍如何在FastAPI中实现请求日志记录和监控,并提供相应的代码示例。一、安装依

win10监控摄像头打开照片的方法win10监控摄像头打开照片的方法Jul 10, 2023 pm 09:41 PM

如果我们手头没有手机,只有电脑,但我们必须拍照,我们可以使用电脑内置的监控摄像头拍照,那么如何打开win10监控摄像头,事实上,我们只需要下载一个相机应用程序。打开win10监控摄像头的具体方法。win10监控摄像头打开照片的方法:1.首先,盘快捷键Win+i打开设置。2.打开后,进入个人隐私设置。3.然后在相机手机权限下打开访问限制。4.打开后,您只需打开相机应用软件。(如果没有,可以去微软店下载一个)5.打开后,如果计算机内置监控摄像头或组装了外部监控摄像头,则可以拍照。(因为人们没有安装摄

Linux下的实时日志监控与分析Linux下的实时日志监控与分析Jul 29, 2023 am 08:06 AM

Linux下的实时日志监控与分析在日常的系统管理和故障排查中,日志是一个非常重要的数据来源。通过对系统日志的实时监控和分析,我们可以及时发现异常情况并进行相应的处理。本文将介绍Linux下如何进行实时日志监控和分析,并提供相应的代码示例。一、实时日志监控在Linux下,最常用的日志系统是rsyslog。通过配置rsyslog,我们可以实现将不同应用程序的日志

Nginx性能监控与安全分析辅助工具Nginx性能监控与安全分析辅助工具Jun 10, 2023 pm 02:41 PM

随着互联网的发展,web应用程序的性能监控以及安全分析越来越受到重视。nginx作为一款高性能的Web服务器和反向代理工具,其在性能监控和安全分析方面也受到广泛的关注和应用。本文将介绍一些Nginx性能监控和安全分析的辅助工具。Nginx性能监控工具NginxAmplifyNginxAmplify是Nginx公司推出的一款性能监控工具。该工具可以

Nginx监控实时状态配置,实时查看网站运行Nginx监控实时状态配置,实时查看网站运行Jul 04, 2023 pm 05:18 PM

Nginx监控实时状态配置,实时查看网站运行引言:Nginx是一款非常流行的反向代理服务器,其高性能和高并发能力使得它成为了许多网站的首选。为了保证网站的稳定运行,我们需要时刻监控Nginx的运行状态。本篇文章将介绍如何配置Nginx实时状态监控,并通过示例代码来让读者更好地理解。一、安装Nginx状态监控模块要实现Nginx的实时状态监控,需要在Nginx

如何使用Golang实现Web应用程序监控如何使用Golang实现Web应用程序监控Jun 24, 2023 am 09:00 AM

在当今的互联网时代,Web应用程序的高效稳定运行是非常重要的。然而,应用程序可能会出现故障或崩溃,影响用户体验。为了确保应用程序的正常运行,我们需要对其进行监控。本文将探讨如何使用Golang实现Web应用程序监控。一、Golang的Web应用程序监控工具Golang拥有非常适合Web应用程序监控的工具。其中最流行的就是Prometheus。Promethe

如何在Linux上设置高可用的网络存储监控如何在Linux上设置高可用的网络存储监控Jul 07, 2023 pm 12:07 PM

如何在Linux上设置高可用的网络存储监控在现代的IT环境中,网络存储是一个关键组件,用于存储和管理海量的数据。为了确保数据的可靠性和高可用性,对网络存储的监控和故障恢复是非常重要的。本文将介绍如何在Linux上设置高可用的网络存储监控,并提供代码示例。第一步:安装监控工具在Linux上,我们可以使用一个开源的监控工具来监控网络存储,比如Nagios。首先,

基于go-zero实现微服务调用链监控基于go-zero实现微服务调用链监控Jun 23, 2023 am 09:53 AM

随着微服务架构的广泛应用,调用链监控已经成为了保障微服务健康运行的重要手段。而基于go-zero框架实现微服务调用链监控,则是更加高效可靠的实现方式。一、调用链监控的基本概念微服务架构中,一个请求可能经过多个微服务组件的调用,这些调用形成了一条调用链。而一旦某一个环节出现问题,整个服务甚至整个系统都有可能受到影响。因此,调用链监控这个技术,就是通过记录整条调

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),