Title: mysql_connect() Error
Last modified: August 31, 2016

---

# mysql_connect() Error

 *  [littlestbookshelf](https://wordpress.org/support/users/littlestbookshelf/)
 * (@littlestbookshelf)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/mysql_connect-error/)
 * I was in my WordPress admin page and received this error message when I refreshed
   my browser.
 * **Warning: mysql_connect(): Too many connections in /home4/brada/public_html/
   wp-includes/wp-db.php on line 1515**
 * Error establishing a database connection
 * I can get into the Dashboard again but I don’t know how to prevent this error
   from happening again. I’m worried I’ll be kicked out again at any time and be
   unable to have access to the what I need to correct.
 * Any help would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/mysql_connect-error/#post-7278850)
 * That’s your web server restricting the connections to your MySQL server. Note
   that that’s not always just from your site. When you’re on a shared hosting server,
   the connection limits are normally pooled between all users, so it can be easy
   to run out.
 * How to fix it is not something that you can do. You will need to talk to your
   hosting company and alert them to the fact that this is happening. They might,
   or might not, do something about it, but that’s the only way to “fix” this issue.
 *  [guillermovargasquisoboni](https://wordpress.org/support/users/guillermovargasquisoboni/)
 * (@guillermovargasquisoboni)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/mysql_connect-error/#post-7278861)
 * I want to report exactly the same error for me !!!
 * I want to add that this is the first time in almost three years with the same
   hosting company that this happened to me. A simple coincidence ? Maybe yes or
   maybe not…
 * Are you also hosted by ovh? Do you also installed today the last wordpress version(
   4.5?)…
 * Maybe something really grave is happening. Calling for help !
 *  Thread Starter [littlestbookshelf](https://wordpress.org/support/users/littlestbookshelf/)
 * (@littlestbookshelf)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/mysql_connect-error/#post-7278863)
 * I’m using Hostgator for my hosting. I haven’t had the issue before. I’m just 
   hoping it doesn’t happen again. It’s very scary.
 *  [magicke](https://wordpress.org/support/users/magicke/)
 * (@magicke)
 * [10 years ago](https://wordpress.org/support/topic/mysql_connect-error/#post-7279177)
 * Working on a wp site for a client. Same error. Hostgator support saying ‘the 
   wp site is consuming too many resources” and that “your theme may be misbehaving”.
   Hosting plan is shared.
 * The site never used to give this error and the problem started cropping up mid-
   to late-march. I’m guessing it’s something Hostgator implemented, but they’re
   insisting it’s the website’s fault. >.<
 *  [Ravikumar Patel](https://wordpress.org/support/users/ravipatel/)
 * (@ravipatel)
 * [10 years ago](https://wordpress.org/support/topic/mysql_connect-error/#post-7279178)
 * Go /wp-includes/wp-db.php on line 1515 just help now for hide warning.
 *     ```
       Find Replace with:
       $this->dbh = mysql_connect
   
       $this->dbh = @mysql_connect
       ```
   
 *  [mkormendy](https://wordpress.org/support/users/mkormendy/)
 * (@mkormendy)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/mysql_connect-error/#post-8642235)
 * Do NOT do what Ravi mentions! It just suppresses the error and doesn’t fix the
   problem which is really causing your server to crash again and again. If you 
   look at Ravi’s website, it doesn’t even load up – and comes up with a database
   error – no wonder!
    -  This reply was modified 9 years, 4 months ago by [mkormendy](https://wordpress.org/support/users/mkormendy/).
    -  This reply was modified 9 years, 4 months ago by [mkormendy](https://wordpress.org/support/users/mkormendy/).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘mysql_connect() Error’ is closed to new replies.

## Tags

 * [error code](https://wordpress.org/support/topic-tag/error-code/)
 * [mysql_connect](https://wordpress.org/support/topic-tag/mysql_connect/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 6 participants
 * Last reply from: [mkormendy](https://wordpress.org/support/users/mkormendy/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/mysql_connect-error/#post-8642235)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
