If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Can't connect to MySQL server on 'server_IP' (99)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-06-09, 15:37
Steele Steele is offline
Registered User
 
Join Date: Sep 2009
Posts: 2
Can't connect to MySQL server on 'server_IP' (99)

Hello,

My website resides on one server and it connects to a remote MySql server.

Intermittently, I am getting following error:

--------------------------------------------------------
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL
server on 'server_IP' (99) in /home/user/public_html/include/db.inc.php on
line 18
Can't connect to MySQL server on '10.78.41.155' (99)
--------------------------------------------------------

Line 18 contains connection to the DB server:

$db_h = mysql_connect(DB_HOST, DB_USER, DB_PASS)


This error comes up randomly, but definitely a lot more during the times when the website traffic is heavier and more users are browsing the site.

I searched everywhere but so far did not figure it out...

Any ideas?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 09-06-09, 16:00
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
so what was the MySQL error.
I'm guessing its going to be something like
"to many connections"

PHP Code:
$cnn=@mysql_connect(HOST,UID1,PWD1) or die(echo mysql_errno().": ".mysql_error());
$dbr=@mysql_select_db(DBN,$cnn) or die (echo mysql_errno().":".mysql_error());
$strSQL "select my,column,list from mytable"
$ResultSet=@mysql_query($strSQL,$cnn) or die (echo mysql_errno().": ".mysql_error()." SQL is":.$strSQL)); 
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 09-06-09, 18:16
mnirwan mnirwan is offline
Registered User
 
Join Date: Sep 2009
Posts: 64
When that happens, try to login to shell and type netstat -n. If you get a lot of open connection in TIME_WAIT status, it may be due to you running out of outgoing port.

Check this link : MySQL Lists: mysql: Re: error 99(?) : can't connect to MySQL server.

You may want to try some kind of DB connection pooling or change it to mysql_pconnect() instead of mysql_connect().
Reply With Quote
  #4 (permalink)  
Old 09-09-09, 18:31
Steele Steele is offline
Registered User
 
Join Date: Sep 2009
Posts: 2
Thanks for your suggestions.

I actually fixed it by lowering the connection timeout from 30 to 10.
Reply With Quote
  #5 (permalink)  
Old 09-09-09, 19:34
jpcola jpcola is offline
Registered User
 
Join Date: Jun 2009
Posts: 5
Recently during my evaluations, I had similar issues with MySQL. I decided to give Raima RDM Server instead and it worked...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On