# 日志记录文件格式
mysqld, Version: 5.7.28-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock
Time Id Command Argument
2021-04-20T09:16:48.572888Z 88 Connect root@172.18.0.1 on using TCP/IP
2021-04-20T09:16:48.574591Z 88 Connect Access denied for user 'root'@'172.18.0.1' (using password: NO)
2021-04-20T09:16:50.325379Z 89 Connect root@172.18.0.1 on using TCP/IP
2021-04-20T09:16:50.329894Z 89 Query select connection_id()
2021-04-20T09:16:50.335222Z 89 Query SELECT @@VERSION
2021-04-20T09:16:50.339432Z 90 Connect root@172.18.0.1 on using TCP/IP
2021-04-20T09:16:50.339621Z 89 Query SELECT @@VERSION_COMMENT
2021-04-20T09:16:50.343525Z 90 Query select connection_id()
2021-04-20T09:16:50.347115Z 90 Query SHOW DATABASES
2021-04-20T09:16:50.380236Z 90 Query select TABLE_NAME, COLUMN_NAME from information_schema.columns
where table_schema = 'None'
order by table_name,ordinal_position
2021-04-20T09:16:50.391019Z 90 Query SELECT CONCAT("'", user, "'@'",host,"'") FROM mysql.user
2021-04-20T09:16:50.415062Z 90 Query SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE="FUNCTION" AND ROUTINE_SCHEMA = "None"
2021-04-20T09:16:50.432015Z 90 Query SELECT name from mysql.help_topic WHERE name like "SHOW %"
2021-04-20T09:16:52.572608Z 89 Query show variables like '%general%'
2021-04-20T09:17:13.532046Z 89 Query show variables like '%general%'
root@127.0.0.1:(none)> show variables like '%slow%';
+---------------------------+-------------------------------+
| Variable_name | Value |
+---------------------------+-------------------------------+
| slow_query_log | ON |
| slow_query_log_file | /var/lib/mysql/mysql.slow.log |
+---------------------------+-------------------------------+
5 rows in set
Time: 0.014s
慢查询时间阈值。
root@127.0.0.1:(none)> show variables like '%long_query_time%';
+-----------------+----------+
| Variable_name | Value |
+-----------------+----------+
| long_query_time | 3.000000 |
+-----------------+----------+
1 row in set
Time: 0.013