0

I have two webservers that are essentially clones of each other, both connecting to a remote MySQL server with the same username/password.

The problem is, one of them connects just fine, but the other one gives me this error:

Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /var/www/includes/classes/DB.php on line 34 Connection has failed 

Both servers have the same DB.php file with the same settings. The firewall is allowing all connections to port 3306. I've commented out the default bind-address of 127.0.0.1. I've granted permissions to my user and ran FLUSH PRIVILEGES.

Is there something else I'm missing? Why would one server be able to connect but not the other?

1
  • What happens when you run telnet failing.server.com 3306, substituting the appropriate hostname? Commented Dec 6, 2010 at 2:54

1 Answer 1

0

I was missing something.

iptables was the culprit. There were rules added by the old sysadmin that only allowed the one webserver to connect. Added a rule and off we go!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.