If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Find the number of active connections per database in MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-11, 06:26
nijicp nijicp is offline
Registered User
 
Join Date: Jul 2011
Posts: 2
Unhappy Find the number of active connections per database in MySQL

Hello all,
I have a drupal application that uses the database named db1. Each time a drupal request is sent, a new connection to database will be established.So after a certain number of conneections has reached the site turns offline showing the following error:

User db1 already has more than 'max_user_connections' active connections.

So my aim is to close the database connection and thereafter avoiding the offline error. For this I need to find the number of active connections made to my database.I have tried with the SHOW PROCESSLIST command. But it is not showing the number of connections.

Is there any method to find the number of database connections made to a mysql database?

Thanks
Reply With Quote
  #2 (permalink)  
Old 07-18-11, 10:58
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
dunno if a an application can make that request. the information is available as various tools including workbench display that.

usually if you are hitting that sort of problem the best solutions are
close what ever connections as possible once the app has terminated using the connections
or if the app supports connection pooling use that
or go back over you system metrics and workout what sort of load you are putting ont he server and decide if you need to increase the number of connections available to the server. this may have an impact on the underlying hardware (you may need more memory a better processor more bandwidth, less clutter on the server and or network).

checking the design of the application software is usually a better way to go first, just increasing the number of connections available may be the final solution but you should check the application first
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 07-20-11, 05:39
nijicp nijicp is offline
Registered User
 
Join Date: Jul 2011
Posts: 2
Thanks for your reply.....
I am trying to close the opened connections. That is the reason why I need to know the number of users connected to my database. By knowing this value I could confirm whether the connections are actually closed or not if I try to close it explicitly.
Reply With Quote
  #4 (permalink)  
Old 07-20-11, 12:43
rpot rpot is offline
Registered User
 
Join Date: Jul 2011
Posts: 10
MySQL Workbench can show you open connections.
Reply With Quote
Reply

Tags
mysql

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On