当前位置:网站首页>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 :
边栏推荐
猜你喜欢
3D图表有效提升数据大屏档次
Plane intersection and plane equation
Nut cloud - sync files on your mobile hard drive on your new computer
送受伤婴儿紧急就医,滴滴司机连闯五个红灯
[JVM] class loading related interview questions - class loading process and parental delegation model
JS from prototype chain to inheritance
Alibaba cloud disk sharing compressed package
美国穆格moog伺服阀D661-4577C
Construction schedule of intelligent management and control platform in Shanxi Chemical Industry Park
A tough battle for Tencent cloud
随机推荐
Required plug-ins for idea
[JVM] class loading related interview questions - class loading process and parental delegation model
Splitting. JS text title slow loading JS effect
Exch:exchange server 2013 is about to end support
[zero basic IOT pwn] environment construction
Combination of applet container and Internet of things
Interview shock 60: what will cause MySQL index invalidation?
How can you choose to work in the county after graduation?
Geo read single cell CSV expression matrix single cell column name change Seurat
EMQ 助力青岛研博建设智慧水务平台
Differential analysis between different groups nichenet for silicosis runs successfully!
leetcode:787. K 站中转内最便宜的航班【k步最短路 + dfs记忆化 + defaultdict(dict)】
Exercise book of introduction to database system
送受伤婴儿紧急就医,滴滴司机连闯五个红灯
New power of data analysis -- the first open source integrated real-time HTAP database in China was released by stonedb
The new version of Shangding cloud | favorites function has been launched to meet personal use needs
ssh工具 pyqt
Compile - compile for itop4412 development board makefile
[零基础学IoT Pwn] 环境搭建
编写C语言的最简单小程序Hello world