mysql 查看登錄的id以及操作的庫:
select * from information_schema.processlist;
統計登錄的ip以及當前操作的ip:
SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;
mysql 查看所有用戶以及允許的ip:
use mysql;
select host, user from user;