1. innotop Installation Reference Official Website: # cdinnotop-1.9.0 install INNOTOP tool is very simple, it is written by PERL, of course
1. innotop Installation Reference Official 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 installation INNOTOP tool is very simple, it is written by PERL, of course
1. innotop Installation
Reference Official 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
Installing the INNOTOP tool is very simple. It is written by PERL. Of course, the PERL environment and related toolkit are required. Before installation, make sure that your system has installed four packages: Time: HiRes, Term: ReadKey, DBI, DBD: mysql.
# perl -MCPAN -eshellCPAN> install Time::HiResCPAN> install Term::ReadKeyCPAN> install DBICPAN> install DBD::mysql
Install the Help file in the decompressed source code path as follows:
# perl Makefile.PL
If no error is reported, use
# make install
In this way, innotop is installed. After installation, the system will have an additional command, innotop
Get help
# innptop --help
Reference Official Website: http://innotop.googlecode.com/svn/html/manual.html
Innotop details-very detailed: http://wenku.baidu.com/link? Url = required _
The query list contains an SLOW parameter, which can be configured and used in the/etc/my. cnf configuration file.
It records all SQL statements that have been executed longer than long_query_time, and helps you find slow SQL statements to optimize these SQL statements.
-----How to enable mysql slow Query-----
1. First, enter mysql and enter the command show variables like '% quer % ';
The log_slow_queries status is OFF and long_query_time is 10;
2. Edit the/etc/my. cnf file.
Add two lines under [mysqld:
log-slow-queries = /var/lib/mysql/mysql-slow.loglong_query_time = 3
Log-slow-queries is the log storage directory, and long_query_time is the maximum number of query seconds (set as needed ).
3. Restart the service to make the configuration take effect.
/etc/init.d/mysqld restart
Enter the database query log_slow_queries status ON again.