?
Solved

PHP Fatal error:  Uncaught Exception: SQLSTATE[HY000] [2002] Cannot assign requested address in

Posted on 2016-09-29
1
Medium Priority
?
940 Views
Last Modified: 2016-10-05
I'm trying to figure out what this error is that I've found in my httpd error_log file.  Sometimes the site shows as not available and tracked it down to this error in the error_log:

 PHP Fatal error:  Uncaught Exception: SQLSTATE[HY000] [2002] Cannot assign requested address in ....

I'm not sure what this means, but I see that I have about 20k open when I run this command:  netstat -anlp | grep :3306 | grep TIME_WAIT -wc

I tried shortening from 60 sec to 3 sec and no change in the connections:
echo "3" > /proc/sys/net/ipv4/tcp_fin_timeout

Is that my issue, connections are not closing out quickly enough?
0
Comment
Question by:Nathan Riley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 79

Accepted Solution

by:
arnold earned 2000 total points
ID: 41822848
Check your code to make sure that you do not leave open connections.
Check variables to see what is the max connection ...... Allowed....

The information in your question provides no other insight,
Does your php code test for the existence of an existing connection before opening a new one?
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question