mysql查看正在执行的sql语句

news/2024/7/7 21:57:53

有2个方法:

1、使用processlist,但是有个弊端,就是只能查看正在执行的sql语句,对应历史记录,查看不到。好处是不用设置,不会保存。

-- use information_schema;
-- show processlist;
或者:
-- select * from information_schema.`PROCESSLIST` where info is not null;

2、开启日志模式

-- 1、设置
-- SET GLOBAL log_output = 'TABLE';  SET GLOBAL general_log = 'ON'; -- SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'OFF'; -- 2、查询 SELECT * from mysql.general_log ORDER BY event_time DESC -- 3、清空表(delete对于这个表,不允许使用,只能用truncate) -- truncate table mysql.general_log;

http://lihuaxi.xjx100.cn/news/238342.html

相关文章

在Unity中创建3D直升机游戏

In this lecture from Colton Ogden, you can learn game development principles by coding a Helicopter Game 3D using Unity and C#. The principles you learn can apply to any programming language and any game.在Colton Ogden的本次演讲中,您可以通过使用…

最新Java面试题答案

JAVA基础 JAVA中的几种基本类型,各占用多少字节? 下图单位是bit,非字节 1B8bit String能被继承吗?为什么? 不可以,因为String类有final修饰符,而final修饰的类是不能被继承的,实现细节不允许改…

简化区块链中的数字签名

想知道更多关于区块链技术知识,请百度【链客区块链技术问答社区】 链客,有问必答!现在我们经常在区块链中看到数字签名这一术语是非常常见的。在发送交易时,无论是比特币、Ethereum、Hyperledger Fabric还是任何其他平台&#xff…

Java基础-泛型

Java基础-泛型 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任。 一.泛型的引入 由于集合可以存储任意类型的元素,导致取出时,如果出现强转就会引发运行时异常(ClassCastException…

spring vertx_如何在Spring设置Vertx

spring vertxby Rick Lee李瑞克(Rick Lee) 如何在Spring设置Vertx (How to set up Vertx in Spring) Spring is probably the most popular framework in the Java space. We all love its dependency injection and all that autowired/configuration magic. It makes unit t…

区块链和去中心化的弱点

想知道更多关于区块链技术知识,请百度【链客区块链技术问答社区】 链客,有问必答!技术人员通常认为区块链是一种纯粹的、无损的产品。即使是那些抨击比特币的人,也会称赞区块链,仿佛这是种超越。 从某种程度上来说&…

塞尔达传说顺序_编码《塞尔达传说》克隆图例

塞尔达传说顺序In this lecture from Colton Ogden, you can learn game development principles by coding a classic Legend of Zelda clone in Lua. The principles you learn can apply to any programming language and any game.在科尔顿奥格登(Colton Ogden)的演讲中&am…

.net core 2.0 部署到centos 7生产环境

.netcore的跨平台如此之火,忍不住想试试 在linux下部署 .net 程序。 借鉴此篇博文:将ASP.NET Core应用程序部署至生产环境中(CentOS7) 虽然是借鉴,但过程坎坷。对从未使用过linux的我难度可想而知,但万事有…