zoukankan      html  css  js  c++  java
  • MySQL 网络访问连接

    查看 /etc/hosts配置文件

    [hotspot@bogon ~]$ cat /etc/hosts
    127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    172.16.11.52 bogon

    分主机查看连接数

    mysql> select count(1) '连接数',host_db.host '客户端' from ( select substring_index(host,':',1) as "host" from processlist ) host_db group by host_db.host;
    +------+---------------+
    | 连接数 | 客户端          |
    +------+---------------+
    |    3 | 172.16.91.237 |
    |    3 | 172.16.91.249 |
    |  186 | bogon         |
    |   12 | localhost     |
    +------+---------------+
    4 rows in set

    上面表格中bogon和localhost都是访问本机,但连接数的差异,是因为jdbc.url的ip地址使用的不同,如果是127.0.0.1 会被映射为localhost,如果是172.16.11.52 则映射为bogon

    分数据库查看连接数

    mysql> select count(1) '连接数',db '数据库' from processlist group by db;
    +------+--------------------+
    | 连接数 | 数据库               |
    +------+--------------------+
    |    1 | NULL               |
    |    3 | bpm                |
    |    3 | bpm_ys             |
    |    3 | epm                |
    |    2 | information_schema |
    |  119 | perform2           |
    |    5 | pms                |
    |   39 | portal             |
    |   29 | security_ys        |
    +------+--------------------+
    9 rows in set

    bash 命令行查看连接数

    mysql -uroot -proot --database='information_schema' -e "select count(1) '连接数',db '数据库名' from processlist group by db;" 2>/dev/null
  • 相关阅读:
    ESLint规则整理与实际应用
    node vue 项目git 管理
    Node.js安装及环境配置之Windows篇
    Windows服务 --- SqlDependency的使用
    插槽
    报表菜单的配置
    HTTP 错误 500.21
    项目部署错误 HTTP Error 500.19
    Steup factory 面板介绍
    Steup Factory 操作注册表
  • 原文地址:https://www.cnblogs.com/zhengwenqiang/p/7202789.html
Copyright © 2011-2022 走看看