MySQL stopped accepting connections after reboot

cyberduck

New member
Joined
Jan 31, 2010
Messages
2
Hiya

I have a Debian box with DirectAdmin and MySQL and all that.

It had been up for 98 days when I did a snapshot restore and rebooted. When it came online MySQL refused connections and I checked what might be the problem. The mysqld was up and running and I could connect to it with the mysql client but all sites on the box was unable to connect to the mysqld.

I discovered that if I changed a configuration file from trying to connect to localhost to 127.0.0.1 instead it all worked perfectly.

I have been trying to seek an explanation to this but can't find any. It just won't connect to localhost from a site but 127.0.0.1 is okay.

hosts-file is just fine pointing localhost to 127.0.0.1 and if I flush all iptables it doesn't make a difference.

Can someone point me in any direction?

Has someone experienced the same problem?
 
Check /etc/hosts

cyberdyck said:
hosts-file is just fine pointing localhost to 127.0.0.1 and if I flush all iptables it doesn't make a difference.

The hosts file hasn't been changed and as I stated in my first message I have already checked it.

I have even tried to use it completely naked like this:
127.0.0.1 localhost
 
Last edited:
The only reason it can use the ip and not the host is if it cannot look it up. You should make sure your server can lookup hostnames fine.
 
Back
Top