Mtop_MySQL, a tool for real-time MySQL monitoring in Linux

Source: Internet
Author: User
Tags install perl
Mtop bitsCN.com, a tool for real-time MySQL monitoring in Linux

Required modules:


Curses

DBI Distributed as Bundle: DBI:

DBD: mysql

Getopt: Long (Distributed with Perl 5)

Net: Domain Part of libnet:

# Perl-e use Curses

# Perl-e use DBI

# Perl-e use DBD: mysql

# Perl-e use Getopt: Long

# Perl-e use Net: Domain

If there is no output, the module is installed. if there is an error, the corresponding module is not installed.


You can download the latest version of the corresponding module from the address given above.

Install the required Perl module:

# Tar zxvf Curses-x.xx.tar.gz

# Cd Curses *

# Perl Makefile. PL

# Make

# Make install

The yum repository contains perl-DBI, so you can directly install yum


# Yum-y install perl-DBI

Because MySQL is compiled and installed, you need to add the lib path to ld. so. conf.


# Vi/etc/ld. so. conf

/Usr/local/mysql/lib/mysql

# Ldconfig

Although the yum repository contains perl-DBD-MySQL, it depends on mysql, so it is still compiled and installed.


# Tar zxvf DBD-mysql-x.xxxx.tar.gz

# Cd DBD-mysql *

# Perl Makefile. PL -- mysql_config =/usr/local/mysql/bin/mysql_config

# Make

# Make install

Install mtop:


# Tar zxvf mtop-0.6.6.tar.gz

# Cd mtop-0.6.6

# Perl Makefile. PL

# Make

# Make install

Add the corresponding MySQL database user:

# Mysql-uroot-pPASSWORD

Mysql> grant reload, PROCESS, super on *. * to identified by mtop;

Mysql> flush privileges;

Mysql> exit

Run:


Because you have customized the location of mysql. sock, you need to make a link to mtop to run it,


# Ln-s/var/run/mysqld/mysql. sock/tmp/mysql. sock

# Mtop -- dbuser = mtop -- password = mtop

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.