• Blog
    • Oracle EBS ERP
      • DBA
      • Developer
      • Application
    • Db2 Database
    • MySQL
  • About Me
  • Skills
  • Education
  • Employment
  • Contact

Identify number of Mysql connections open

  • Home
  • Identify number of Mysql connections open

Sometimes DBA or Developer need to identify which connections are open in background so they can identify through below script.

Execute below script on mysql shell.

SELECT IFNULL(usr,'All Users') user,IFNULL(hst,'All Hosts') host,COUNT(1) Connections
FROM
(
    SELECT user usr,LEFT(host,LOCATE(':',host) - 1) hst
    FROM information_schema.processlist
    /*WHERE user NOT IN ('system user','root')*/
) A GROUP BY usr,hst WITH ROLLUP;

Second option to identify the running / open connection through below script in mysql shell.

show full processlist;
SHOW GLOBAL STATUS LIKE 'Threads_running'; 
show status where `variable_name` = 'Threads_connected';

Tags
identify open connection, mysql, open connection in mysql, open connection on database
Categories
  • Application
  • Db2 Database
  • DBA
  • Developer
  • MySQL
  • Oracle EBS ERP
o
  • Extract & restore single mysql table from backup of databaseSaturday - September 04, 2021
© 2019 KS is proudly powered by Kapil Savaliya.