-- 筛选报错
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 的查询结果是一样的,用后面的方法查询就好了。
运行效果图:
![MySQL 数据库show processlist where条件筛选报错解决方法,[Code: 1064, SQL State: 42000] You have an error in your_sql](https://file.cfanz.cn/uploads/png/2022/02/11/8/4H9479P2e9.png)
喜欢的点个赞❤吧!










