The database enables slow query logs Modify the configuration file Add the following two sentences to the configuration file my.ini log-slow-queries = C:\xampp\mysql_slow_query.log long_query_time=3 The first sentence is used to define the path of the slow query log (if it is a Linux system, it will involve permission issues) The second sentence is used to define queries that take more than a certain number of seconds as slow queries, in seconds. Check whether the configuration is successful: //View the slow query time, unit: s show variables like "long_query_time"; //View the slow query configuration show status like "%slow_queries%"; //View the slow query log path show variables like "%slow%"; Execute a slow query operation to verify whether the log is recorded: The amount of data in the environment you build is small, so it is difficult to simulate the execution of slow queries. You can use the following statement to simulate instead: SELECT SLEEP(10), name from user where userid=1; View the number of slow queries: show global status like '%slow%'; Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: How to use rem adaptation in Vue
1. Transaction characteristics (ACID) (1) Atomici...
Table of contents What is an agent Basic knowledg...
Installation Environment WIN10 VMware Workstation...
Preface This article summarizes some implementati...
Let's briefly sort out the configuration of s...
<br />Original URL: http://www.lxdong.com/po...
Websites without https support will gradually be ...
Table of contents 1. What is Docker Compose? 2. D...
Preface The this pointer in JS has always been a ...
Now let's summarize several situations of con...
Previously, I introduced the use of the charAt() ...
Table of contents MySQL Common Functions 1. Numer...
JBoss uses Tomcat as the Web container, so the co...
Preface We have already installed Docker and have...
In actual work, JavaScript regular expressions ar...