当前位置:网站首页>MySQL之零碎知识点
MySQL之零碎知识点
2022-06-30 16:16:00 【wang0907】
写在前面
本部分用来记录MySQL学习过程中比较小的零碎知识点,分享出去的同时也方便自己后续查看。
1:慢日志
慢日志主要参数如下:
控制开关:slow_query_log
写慢日志执行时长:long_query_time
慢日志文件:slow_query_log_file
如下设置:
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)
为了测试效果将long_query_time设置为0,这样所有执行的sql语句都会记录到慢日志中,比如执行如下的sql语句:
mysql> select count(*) from t;
+----------+
| count(*) |
+----------+
| 100000 |
+----------+
就可以查看生成的慢日志了:

写在后面
参考文章列表:
边栏推荐
- 新技能:通过代码缓存加速 Node.js 的启动
- 【网易云信】播放demo构建:无法将参数 1 从“AsyncModalRunner *”转换为“std::nullptr_t”**
- Cesium-1.72 learning (camera tracking)
- [proteus simulation] Arduino uno uses 74ls148 to extend interrupt
- Course design for the end of the semester: product sales management system based on SSM
- Splitting.js文本标题缓慢加载js特效
- How to connect the Internet Reading Notes - Summary
- 解决方法:STM32使用cJSON解析数据失败
- 以往我们认识的产业互联网,只是以消费互联网的替代者的身份出现
- 美国穆格moog伺服阀D661-4577C
猜你喜欢

Canvas cloud shape animation
![leetcode:1042. Do not plant flowers adjacent to each other [randomly fill in qualified + no contradiction will be formed behind + set.pop]](/img/eb/3264776ff46e4bff628fb84d94db88.png)
leetcode:1042. Do not plant flowers adjacent to each other [randomly fill in qualified + no contradiction will be formed behind + set.pop]

Cesium-1.72 learning (eagle eye map of the earth)

美国PARKER派克传感器P8S-GRFLX

数据分析新动力——国内首款开源一体化实时HTAP数据库石原子StoneDB发布

Nouvelle version de shangdingyun | la fonction favorite est en ligne pour répondre aux besoins d'utilisation personnelle

Parker proportional overflow valve rs10r35s4sn1jw

parker变量柱塞泵PV092R1K1T1NMMC

How can you choose to work in the county after graduation?

Nodejs learning notes II
随机推荐
送受伤婴儿紧急就医,滴滴司机连闯五个红灯
24: Chapter 3: develop pass service: 7: user defined exceptions (to represent errors in the program); Create graceexceptionhandler to handle exceptions globally and uniformly (build JSON data of corre
博士毕业去县城工作,如何是你,怎么选?
腾讯云的一场硬仗
Ningx 1.20.2
How can you choose to work in the county after graduation?
浅析搭建高速公路视频监控平台的建设方案及必要性
Dart: string replace related methods
Splitting. JS text title slow loading JS effect
Interview shock 60: what will cause MySQL index invalidation?
EMQ helps Qingdao Yanbo build a smart water platform
Horizontal visual error effect JS special effect code
A tough battle for Tencent cloud
开发那些事儿:如何在视频中添加文字水印?
Plane intersection and plane equation
Hyper-v:在虚拟网络中启用 SR-IOV
Compile - compile for itop4412 development board makefile
Exch:Exchange Server 2013 即将终止支持
将 EMQX Cloud 数据通过公网桥接到 AWS IoT
Parker variable displacement piston pump pv092r1k1t1nmmc