Mytop is an open-source, command-line tool used for monitoring MySQL performance. Using mytop, we can monitor (in real-time) MySQL threads, queries, and uptime as well as see which user is running queries on which database, which are the slow queries, and more

Step1. Install the package

yum install mariadb-server mariadb

Step2. Start/enable the service

systemctl start mariadb
systemctl enable mariadb

Step3. Setup database

mysql_secure_installation

Step4. Install the mytop

yum install mytop

Step5. Run the command

mytop

Step6. Configure the mytop

Note:: Before using mytop, create a customized configuration file for mytop named .mytop

vi /root/.mytop
host=localhost
 db=mysql
 delay=3
 port=3306
 socket=
 batchmode=0
 color=1
 idle=0

Step7. To monitor database

mytop - -prompt

Step8. Create a database

mysql -u root -p
CREATE DATABASE db;
CREATE USER 'myuser' IDENTIFIED BY 'password';
GRANT ALL privileges ON db.* TO 'myuser'@localhost;
FLUSH PRIVILEGES;
exit

Step9. Test the database

mytop -u myuser -p password -d db

LEAVE A REPLY

Please enter your comment!
Please enter your name here