Method a: set the global variable
to slow_query_log global variable is set to "ON" state
mysql> set global slow_query_log = 'ON ';
set slow query location of the log storage
mysql> set global slow_query_log_file = '/ usr / local / mysql / data / slow .log ';
Discover more than one second is recorded
mysql> set global long_query_time = 1;
method two: profile settings
to modify the configuration file my.cnf, below the [mysqld] were added under
[mysqld]
slow_query_log the oN =
slow_query_log_file = / usr / local / MySQL / Data / slow.log
long_query_time. 1 =
Restart mysql