• 技术文章 >数据库 >MySQL

    mysql怎么查看连接数

    FXLFXL2020-09-07 09:12:43原创2222

    具体方法:

    (推荐教程:mysql数据库学习教程

    查看当前连接数

    ./mysql -uroot -p1234.com -e 'show status' | grep -i  Threads 
    Delayed_insert_threads    0
    Slow_launch_threads    0
    Threads_cached    1
    Threads_connected    1
    Threads_created    2
    Threads_running    1 ##(当前连接数)
    mysql> show status like 'Threads%';
    +-------------------+-------+
    | Variable_name    | Value |
    +-------------------+-------+
    | Threads_cached    | 1    |
    | Threads_connected | 1    |
    | Threads_created  | 2    |
    | Threads_running  | 1    |   ###当前连接数
    +-------------------+-------+
    4 rows in set (0.00 sec)

    查看连接数

    [root@xxx bin]# ./mysql -uroot -p1234.com -e 'show variables' | grep max_connections
    max_connections    500
    mysql> show global variables like 'max_conn%';
    +--------------------+-------+
    | Variable_name      | Value |
    +--------------------+-------+
    | max_connect_errors | 10    |
    | max_connections    | 500  |## 连接数
    +--------------------+-------+
    2 rows in set (0.00 sec)
    专题推荐:mysql 连接数
    上一篇:mysql如何在表中新增一列 下一篇:mysql中事物怎么使用

    相关文章推荐

    • django怎么连接数据库查询• mysql数据库如何连接(php连接数据库)

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网