查看 /etc/hosts配置文件
[hotspot@bogon ~]$ cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain :: localhost localhost.localdomain localhost6 localhost6.localdomain6 172.16.11.52 bogon
分主机查看连接数
mysql) ) as "host" from processlist ) host_db group by host_db.host; +------+---------------+ | 连接数 | 客户端 | +------+---------------+ | 172.16.91.237 | | 172.16.91.249 | | bogon | | localhost | +------+---------------+ rows in set
上面表格中bogon和localhost都是访问本机,但连接数的差异,是因为jdbc.url的ip地址使用的不同,如果是127.0.0.1 会被映射为localhost,如果是172.16.11.52 则映射为bogon
分数据库查看连接数
mysql) '连接数',db '数据库' from processlist group by db; +------+--------------------+ | 连接数 | 数据库 | +------+--------------------+ | NULL | | bpm | | bpm_ys | | epm | | information_schema | | perform2 | | pms | | portal | | security_ys | +------+--------------------+ rows in set
bash 命令行查看连接数
mysql -uroot -proot --database=>/dev/null