Results 1 to 3 of 3

Thread: Database error - Cannot establish a connection with database

  1. #1
    Join Date
    Nov 2012

    Database error - Cannot establish a connection with database

    i have the website www.mymobile.co.in.

    We are facing a problem with our MySQL database. It gives an error every now and then : Cannot establish a connection with the database

    We thought its the server problem, hence moved to a new one with VPS and Cpanel/whm. But still we are getting the same error.

    The website is made on wordpress and we went with godaddy.com now. However godaddy does not give support to VPS customers, who are one of the highest paying people (strange)

    Can anyone help me out, what could be the issue?

    Everytime i get this error i have to restart the MySQL service for the website to work again. Is it a problem with our comparison feature on the website, which is on AJAX.


  2. #2
    Join Date
    Aug 2004
    It's hard to tell from a distance, so to speak. One thing I might check is whether you're connecting with a persistent connection or not (mysql_pconnect() if using the old MySQL extension in PHP). From what I've seen and read, if you don't get all the configuration settings just so, persistent connections can end up leaving "zombie" processes hanging around until there are no available connections left. The simplest fix in that situation is to just use mysql_connect() instead, possibly losing the (usually very small) performance gain you get with persistent connections.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Nov 2012
    will let you know, will try the settings...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center