文档首页/ 云数据库 RDS/ 常见问题/ 数据库连接/ 如何查看当前时间所有连接数据库的IP
更新时间:2022-08-11 GMT+08:00

如何查看当前时间所有连接数据库的IP

在数据库上执行以下SQL语句,统计IP连接数。

SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;