This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

message from server "too many connections".

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am building a small project.  And stuck in error "message from server "too many connections"." returned by mysql server when i tried to run my application. But it is connecting fine when I tried to connect fro my client to mysql server using following command :-
and passing an appropriate password. how to get rid of this "error "too many connections".
 
Marshal
Posts: 69889
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, but please provide more details including how often you have run that app, and how you closed the connections.
Discussion added to our databases forum.
 
Saloon Keeper
Posts: 22289
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What that usually means is that you are obtaining a Connection every time you do something with the database - which is OK (when done right). But you are not closing them when you are done with them.

There are only a finite amount of network resources available for Connections, so it is important to close them when you are done with them.

This sort of leakage can also occur if you get a database error and don't close the connection in the database error handling code.

I should mention that simply letting go of Connections and expecting garbage collection to deal with them isn't good enough. For one thing, garbage collection doesn't run often enough. For another, there's no guarantee that the garbage collector will know about the internal resources that have to be closed at the OS level.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic