当前位置:网站首页>Fragmentary knowledge points of MySQL
Fragmentary knowledge points of MySQL
2022-06-30 17:31:00 【wang0907】
Write it at the front
This section is used to record MySQL Small pieces of knowledge in the learning process , It is also convenient for you to check later when sharing .
1: Slow log
The main parameters of the slow log are as follows :
Control switch :slow_query_log
Slow log writing execution time :long_query_time
Slow log files :slow_query_log_file
The following settings :
mysql> set global slow_query_log=1;
Query OK, 0 rows affected (0.04 sec)
mysql> show variables like 'slow_query_log';
+---------------------+---------------------------------------------------------------+
| Variable_name | Value |
+---------------------+---------------------------------------------------------------+
| slow_query_log | ON |
+---------------------+---------------------------------------------------------------+
1 rows in set (0.00 sec)
mysql> set long_query_time=0;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'long_query_time';
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| long_query_time | 0.000000 |
+-----------------+----------+
1 row in set (0.00 sec)
mysql> show variables like 'slow_query_log_file';
+---------------------+---------------------------------------------------------------+
| Variable_name | Value |
+---------------------+---------------------------------------------------------------+
| slow_query_log_file | D:\program_files\phpstudy\PHPTutorial\MySQL\data\jhp-slow.log |
+---------------------+---------------------------------------------------------------+
1 row in set (0.00 sec)
In order to test the effect long_query_time Set to 0, So all the sql Statements are recorded in the slow log , For example, execute the following sql sentence :
mysql> select count(*) from t;
+----------+
| count(*) |
+----------+
| 100000 |
+----------+
You can view the generated slow log :

Written in the back
Refer to the list of articles :
边栏推荐
- Advanced Mathematics (Seventh Edition) Tongji University General exercises one person solution
- 生成对抗网络,从DCGAN到StyleGAN、pixel2pixel,人脸生成和图像翻译。
- [C language] explain threads - start two threads
- Exch: database integrity checking
- Splitting.js文本标题缓慢加载js特效
- Implementation of graduation project management system based on SSM
- Horizontal visual error effect JS special effect code
- addmodule_ allmerge_ ams_ im
- List becomes vector list becomes vector list vector
- Network: principle and practice of server network card group technology
猜你喜欢

New power of data analysis -- the first open source integrated real-time HTAP database in China was released by stonedb

New skill: accelerate node through code cache JS startup

Interview shock 60: what will cause MySQL index invalidation?

Booking UI effect implemented by svg

Cesium-1.72 learning (China national boundary)

SSH tool pyqt
![Ten thousand volumes - list sorting [01]](/img/d4/124101b919a4d8163a32fc0f158efa.png)
Ten thousand volumes - list sorting [01]

Cloud practice of key business migration of Internet of things by well-known Internet housing rental service companies

Development: how to install offline MySQL in Linux system?

中基协:推荐使用电子合同
随机推荐
【Proteus仿真】Arduino UNO利用74LS148扩展中断
6 張圖帶你搞懂 TCP 為什麼是三次握手?
NielsenIQ迎来零售实验室负责人Dawn E. Norvell,将加速扩张全球零售战略
5g business is officially commercial. What are the opportunities for radio and television?
Horizontal visual error effect JS special effect code
A scheduled task deletes data at a specified time
高等数学(第七版)同济大学 总习题一 个人解答
中基协:推荐使用电子合同
canvas云朵形状动画
[JVM] takes you to learn about the garbage collection mechanism (GC) in the JVM -- including diagrams
[zero basic IOT pwn] environment construction
Cesium-1.72 learning (earth rotation)
Login box tricks
[C language] explain threads in detail - solve the problem of shared memory caused by concurrent programs by "locking"
MOOG servo valve d661-4577c
Cesium-1.72 learning (eagle eye map of the earth)
China Infrastructure Development Association: electronic contract is recommended
编译生成busybox文件系统
Cloud practice of key business migration of Internet of things by well-known Internet housing rental service companies
万卷书 - 书单整理 [01]