#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    56
    Rep Power
    15
    I'd read other people's posts in this area, but none has a solution to this problem. I'm hoping that someone would be able to help me with it.

    I'm using mysql_pcconnect (persistent) and after like 6-7 reloads I get an error msg saying 'too many connection' or such. Now is there a way that I can explicitely close the connection at the end of the script for mysql_pcconnect so this wouldn't happen again? I'm using a web hosting service so I can't change the settings in mySQL.

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    Why did you choose to use _pconnect? Just curious. It hasn't given me any noticeable benefit when I have used it, but I have received the same error that you have witnessed.

    PHP.net has the answer to your question: http://www.php.net/manual/features.p...onnections.php
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Norcross, GA
    Posts
    458
    Rep Power
    15
    benliong,
    I went through this a couple months ago. After switching my connect statements to pconnect, freeing results, closing db's, ect.., I still got 'TMC' errors. The code was clean and I had minimal db queries - it was driving me bonkers!

    Finally someone suggested that it wasn't an issue with the code, rather it was the server my scripts were running on. I was with addr.com which provided dirt cheap hosting (and a lot of webspace). What i figure is there were too many mysql db's running on the same server as mine, thereby overloading the machine.

    I proved myself right by getting a new webhost (www.communicom-inc.com). Not a single file has changed - and I haven't received a 'too many connections' error since transferring the site.

    hth,
    Mike
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    56
    Rep Power
    15
    Thanks mstembri.

    So if I decided to run my very own mysql server it would solve the problem completely I guess.

    Really appreciate your help. Thanks again.

    --Ben

Similar Threads

  1. ado connection
    By gratz in forum Visual Basic Programming
    Replies: 5
    Last Post: June 2nd, 2004, 08:02 PM
  2. Custom error message for MySQL connection
    By dbr1066 in forum PHP Development
    Replies: 6
    Last Post: February 12th, 2004, 12:25 PM
  3. Database connection problems
    By felinx in forum Java Help
    Replies: 0
    Last Post: December 14th, 2003, 03:43 PM
  4. db connection problem.
    By tjtee in forum Java Help
    Replies: 4
    Last Post: October 30th, 2003, 12:58 AM
  5. connection string
    By zimm in forum ASP Programming
    Replies: 8
    Last Post: August 24th, 2003, 03:48 PM

IMN logo majestic logo threadwatch logo seochat tools logo