MYSQL???????????????
???????????? ???????[ 2016/4/25 10:35:12 ] ????????MySQL ?????
?????????????????????????????????????????????????MYSQL????????????е?????????????
????=========================================================
??????????? ????????????????????????????????????
????Mysql5.0?????汾??????????б??????SQL???????????
????mysql> show variables like 'long%'; ??????long_query_time???????????????????????“?????”
????+-----------------+-----------+
????| Variable_name | Value |
????+-----------------+-----------+
????| long_query_time | 10.000000 |
????+-----------------+-----------+
????1 row in set (0.00 sec)
????mysql> set long_query_time=1; ??? ????????1?? ???????????1?????????????
????Query OK?? 0 rows affected (0.00 sec)
????mysql> show variables like 'slow%';
????+---------------------+---------------+
????| Variable_name | Value |
????+---------------------+---------------+
????| slow_launch_time | 2 |
????| slow_query_log | ON | ?????????????
????| slow_query_log_file | /tmp/slow.log | ??? ???????λ??
????+---------------------+---------------+
????3 rows in set (0.00 sec)
????mysql> set global slow_query_log='ON' ???????????
???????slow_query_log???????????ON??mysql??????????????
????/etc/my.cnf ???????????????MYSQL?????????????
????long_query_time=1
????slow_query_log_file=/tmp/slow.log
????====================================================
??????????:mysqldumpslow????
????/path/mysqldumpslow -s c -t 10 /tmp/slow-log
????????????????????10??SQL??????У?
????-s?? ?????????????????c??t??l??r????????????????????????????????????????ac??at??al??ar?????????????
????-t?? ??top n?????????????????????????????
????-g?? ??????д????????????????Сд????е??
????????
????/path/mysqldumpslow -s r -t 10 /tmp/slow-log
??????????????????10???????
????/path/mysqldumpslow -s t -t 10 -g “left join” /tmp/slow-log
????????????????????10?????溬??????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11