In Linux, enable MySQL slow query. The configuration file of MySQL in Windows is usually my. cnf. Find [mysqld] and add log-slow-queriesdatamysqldatas.
In Linux, enable MySQL slow query. The configuration file of MySQL in Windows is usually my. cnf. Find [mysqld] and add log-slow-queries =/data/mysqldata/s.
MySQL slow query record logs are useful for tracking MySQL load tuning issues in the PHP + MySQL system, such as installing a lot of Discuz! Plug-in users, so that you can probably find out which plug-ins have code problems. In fact, it is very easy to enable MySQL slow query logs. You only need to add the log-slow-queries and long_query_time parameters to the MySQL configuration file.
Enable MySQL slow query in Windows
In Windows, the configuration file of MySQL is usually my. ini. Find [mysqld] and add
Log-slow-queries = F: \ MySQL \ log \ mysqlslowquery. log
Long_query_time = 2
Enable MySQL slow query in Linux
The configuration file of MySQL in Windows is usually my. cnf. Find [mysqld] and add
Log-slow-queries =/data/mysqldata/slowquery. log
Long_query_time = 2
Note:
Log-slow-queries = F: \ MySQL \ log \ mysqlslowquery. log is the location where full query logs are stored. Generally, this directory requires the write permission of the MySQL running account. Generally, this directory is set to the MySQL data storage directory;
2 In long_query_time = 2 indicates that the query takes more than two seconds to record