-- 筛选报错
show processlist where user = 'root';
-- 筛选可用
select * from information_schema.processlist where user = 'root';
报错信息如下:
据说是因为 bug,官方还专门声明过。
[Code: 1064, SQL State: 42000] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where user = 'root'' at line 1
show processlist 和 select * from information_schema.processlist 的查询结果是一样的,用后面的方法查询就好了。
运行效果图:
喜欢的点个赞?吧!