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