title: What can cause "too many database connections"
body: <p>My Wordpress website got a "error establishing connection to database" massage.</p>
  
  <p>My host informed me it was because my "user" had too many database connections that were open at once. This caused an error making additional connections, and thus the massage.</p>
  
  <p>This has been corrected by killing deadlocked database connections. There were a number of connections copying data to temporary tables, but the deadlock was caused by a large set of lookups waiting for one update.</p>
  
  <p><strong>Can someone explain to me how this might have happened, and how to avoid it?</strong></p>
  
  <p>(p.s: that WP installation has over 2000 posts)</p>