Tools
首页
画图
音乐
采集
记事
博客
实验室
登录
lypeng
146
文章
11
分类
46
记事
分类
生活-[23]
Linux-[24]
前端-[9]
数据库-[16]
PHP-[31]
git-[7]
其他-[6]
python-[20]
算法-[4]
React-Native-[4]
中草药-[2]
广告位1
广告位2
首页
/ 数据库
返回列表
Mysql5.7查看已经执行的sql语句
阅读:595
发布:2020-09-21
作者:lypeng
Mysql5.7查看已经执行的sql语句 首先是在mysql的配置文件 my.ini中加入 ``` [mysqld] general-log=1 log-output=FILE general-log-file="D:/phpStudy/MySQL/data/run.sql" ``` 然后重启一下mysql 这个文件就会出来了,然后你就可以查看已经执行的sql语句了~ ** 注意不同的MySQL版本,应该有不同的设置,请自行百度~ ** 日志示例如下: ``` D:\phpStudy\mysql\bin\mysqld.exe, Version: 5.7.30-log (MySQL Community Server (GPL)). started with: TCP Port: 3306, Named Pipe: (null) Time Id Command Argument 2020-09-21T09:05:48.284462Z 2 Connect root@localhost on using TCP/IP 2020-09-21T09:05:48.284792Z 2 Query /*!40101 set @@session.wait_timeout=28800 */ 2020-09-21T09:05:48.285111Z 2 Query show full tables from `s2` where table_type = 'BASE TABLE' 2020-09-21T09:05:50.919974Z 2 Query select * from `s2`.`dp_article` limit 0, 1000 2020-09-21T09:05:50.936842Z 2 Query show create table `s2`.`dp_article` 2020-09-21T09:05:50.937355Z 2 Query show full fields from `s2`.`dp_article` 2020-09-21T09:05:50.938214Z 2 Query show keys from `s2`.`dp_article` 2020-09-21T09:06:38.395954Z 2 Query show full fields from `s2`.`dp_article` 2020-09-21T09:06:38.401046Z 2 Query show keys from `s2`.`dp_article` 2020-09-21T09:06:38.404352Z 2 Query show create table `s2`.`dp_article` 2020-09-21T09:07:14.020612Z 2 Query SHOW VARIABLES LIKE 'profiling' 2020-09-21T09:07:14.046814Z 2 Query SET PROFILING = 1 2020-09-21T09:07:14.047492Z 2 Query SET profiling_history_size = 0 2020-09-21T09:07:14.048181Z 2 Query SET profiling_history_size = 15 2020-09-21T09:07:14.049175Z 2 Query SHOW STATUS 2020-09-21T09:07:14.053216Z 2 Query SHOW STATUS 2020-09-21T09:07:14.057916Z 2 Query use `s2` 2020-09-21T09:07:14.059932Z 2 Query select * from dp_article where id<5 LIMIT 0, 1000 2020-09-21T09:07:14.065707Z 2 Query SHOW STATUS 2020-09-21T09:07:14.069433Z 2 Query SHOW PROFILES 2020-09-21T09:07:14.071431Z 2 Query select state, round(sum(duration),5) as `duration (summed) in sec` from information_schema.profiling where query_id = 7 group by state order by `duration (summed) in sec` desc 2020-09-21T09:07:14.072996Z 2 Query SET PROFILING = 0 2020-09-21T09:07:14.148676Z 2 Query EXPLAIN select * from dp_article where id<5 LIMIT 0, 1000 2020-09-21T09:10:35.519022Z 2 Query SET PROFILING = 1 2020-09-21T09:10:35.522283Z 2 Query SET profiling_history_size = 0 2020-09-21T09:10:35.529350Z 2 Query SET profiling_history_size = 15 2020-09-21T09:10:35.534427Z 2 Query SHOW STATUS 2020-09-21T09:10:35.538757Z 2 Query update dp_article set cid=6 where id=491 2020-09-21T09:10:35.545314Z 2 Query SHOW STATUS 2020-09-21T09:10:35.549286Z 2 Query SHOW PROFILES 2020-09-21T09:10:35.550268Z 2 Query select state, round(sum(duration),5) as `duration (summed) in sec` from information_schema.profiling where query_id = 13 group by state order by `duration (summed) in sec` desc 2020-09-21T09:10:35.551651Z 2 Query SET PROFILING = 0 2020-09-21T09:10:35.563738Z 2 Query EXPLAIN update dp_article set cid=6 where id=491 2020-09-21T09:11:16.966657Z 3 Connect root@localhost on using SSL/TLS 2020-09-21T09:11:16.967137Z 3 Query show databases 2020-09-21T09:11:53.137000Z 3 Query SELECT DATABASE() 2020-09-21T09:11:53.137283Z 3 Init DB s2 2020-09-21T09:11:56.984270Z 3 Query show tables 2020-09-21T09:12:09.613805Z 3 Query desc dp_article 2020-09-21T09:12:33.679874Z 3 Query select database() 2020-09-21T09:12:57.704290Z 2 Quit ```
------本文结束
感谢阅读------
上一篇:
Windows安装MySQL5.7.30
下一篇:
mysql日志