mysql> show variables like 'log_slow_queries'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | log_slow_queries | OFF | +------------------+-------+ 1 row in set (0.01 sec)
样例如下: [root@localhost mysqlsla-2.03]# more /etc/my.cnf [mysqld] datadir=/var/lib/mysql log_bin=/tmp/mysql/bin-log/mysql-bin.log log_bin=ON socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1
mysql> show variables like 'log_slow_queries'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | log_slow_queries | ON | +------------------+-------+ 1 row in set (0.00 sec)
mysql> show variables like 'long_query_time'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | long_query_time | 2 | +-----------------+-------+ 1 row in set (0.00 sec)