Mytop Installation and use

Source: Internet
Author: User

Installing Mytop

1. Create a new file in/ETC/YUM.REPO.D 21andy.com.repo
[21andy.com]
name=21andy.com Packages for Enterprise Linux 5-$basearch
baseurl=http://www.21andy.com/centos/5/$basearch/
Enabled=1
Gpgcheck=0

2. Enable the EPEL Warehouse
I386
RPM-IHV http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

x86_64
RPM-IHV http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm

3. Now you can go straight to yum.
Yum-y Install Mytop

4. Install the configuration file for configuration file Mytop in ~/.mytop to create a new
# Vim ~/.mytop

Enter the following to save
user= your MySQL user
pass= your MySQL password
Host=localhost
db= the name of the database you want to monitor
Delay=5
port=3306
Socket=/var/lib/mysql/mysql.sock
Batchmode=0
Header=1
Color=1
Idle=1

Note that the socket setting is the same as the path in my.cnf, generally we are mytop and MySQL on the same machine

The source of this article: http://www.21andy.com/blog/

OK, the installation is complete, now run Mytop try the effect

Mytop Command Parameters
-U/--user <username>: Specify USERNAME, default is root
-P/--pass/--password <password>: Specify password, default is None
-H/--host
-P/--port <port>: Specify port to connect to MySQL server, default is 3306
-S/--delay <seconds>: Updated number of seconds, preset is 5 seconds
-d/--db/--database <database>: Specify connected repositories, default is test
-b/--batch/--batchmode: Specified as batch mode, each update will not clear the old display results, the update data is displayed on the top, the preset is unset
-S/--socket <path_to_socket>: Specifies to use MySQL socket direct connection instead of TCP/IP connection, default is None (when Mytop and MySQL are used on the same platform)
--header Or-noheader: If you want to display the header, the default is header
--color or--nocolor: If you want to use a color, the preset is color
If the thread of the-I/-idle or-noidle:idle is to appear on the list, the default is idle

[note] because there is a password for MySQL server in the. Mytop, please note the file permissions

Mytop shortcut keys
S: Set update time
P: Pause Screen update
Q: Leave
U: See thread of a user only
O: Reverse the order of arrangement

Mytop Remote Monitoring
If you install Mytop on another machine, you need to set permissions on the MySQL server to remotely monitor

(1) Add an account to MySQL server and give it process permissions
Mysql-u root-p
Mysql> Grant Process on * * to <REMOTE_USERNAME>@<REMOTE_IP> identified by ' <PASSWORD> ';
mysql> flush Privileges;
Mysql> Exit

(2) in the installation of Mytop computer, with parameters to specify or modify the configuration file Settings
Mytop-u <REMOTE_USERNAME>-P <PASSWORD>-H <MYSQL_SERVER_IP>

or modify. Mytop
User=<remote_username>
Pass=<password>
host=<mysql_server_ip>

Mytop Installation and use

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.