1.innotop Installation
Reference website: http://innotop.googlecode.com/svn/html/installing.html
# wget http://innotop.googlecode.com/files/innotop-1.9.0.tar.gz
# TAR-ZXVF innotop-1.9.0.tar.gz
# CD innotop-1.9.0
The installation of the Innotop tool is very simple, written by Perl, and of course requires a Perl environment and related toolkits. Before you install, make sure your system installs Time::hires,term::readkey,dbi,dbd::mysql four packages
# Perl-mcpan-eshell
cpan> Install time::hires
cpan> install
term::readkey cpan> Install DBI Cpan> Install Dbd::mysql
There are installation help files under the uncompressed source path, as follows:
If there is no error, then use the
This installs the Innotop, after the installation system will have one more command, Innotop
Get help
Reference website: http://innotop.googlecode.com/svn/html/manual.html
Innotop details--Very detailed: http://wenku.baidu.com/link?url=0cvUfYA5gwKfwvoo1gGPkr9NfK1eZ5UHa3gAhXB-pwlOLQDyH_Y_ Bn8q5kfii89rz_9egwjjlwmiqbsz4hogg0a-w1ngvnbmbrlqwmxgwz_
There is a slow parameter in the query list that can be configured to use in the/ETC/MY.CNF configuration file
It can record all the SQL statements that execute over long_query_time time, and help you to find the SQL that executes slowly, which makes it easier for us to optimize the SQL.
----- How to turn on MySQL slow query -----
1. First, enter MySQL, enter the command show variables like '%quer% ';
You will see that the state of the log_slow_queries is off;long_query_time to 10;
2. Edit/etc/my.cnf File
Add two lines under [mysqld]:
Log-slow-queries =/var/lib/mysql/mysql-slow.log
long_query_time = 3
Log-slow-queries a directory for the log; Long_query_time is the maximum number of seconds (set according to your needs).
3. Restart service to make configuration effective
/etc/init.d/mysqld restart
Re-enter database query log_slow_queries state is on.