mysql: see all open connections to a given database?

后端 未结 8 2000
感动是毒
感动是毒 2020-12-04 05:57

With administrative permissions im mysql, how can I see all the open connections to a specific db in my server?

相关标签:
8条回答
  • 2020-12-04 06:35

    In query browser right click on database and select processlist

    0 讨论(0)
  • 2020-12-04 06:36

    SQL: show full processlist;

    This is what the MySQL Workbench does.

    0 讨论(0)
  • 2020-12-04 06:40

    That should do the trick for the newest MySQL versions:

    SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE DB = "elstream_development";

    0 讨论(0)
  • 2020-12-04 06:42

    In MySql,the following query shall show the total number of open connections:

    show status like 'Threads_connected';
    
    0 讨论(0)
  • 2020-12-04 06:44

    If you're running a *nix system, also consider mytop.

    To limit the results to one database, press "d" when it's running then type in the database name.

    0 讨论(0)
  • 2020-12-04 06:48

    The command is

    SHOW PROCESSLIST
    

    Unfortunately, it has no narrowing parameters. If you need them you can do it from the command line:

    mysqladmin processlist | grep database-name
    
    0 讨论(0)
提交回复
热议问题