Chris Weldon bio photo

Chris Weldon

A savvy software engineer and agilist, Chris slings code in C#, but has also been known for commanding fleets of systems. He's currently a Tech Lead at Wolters Kluwer.

Email Twitter Facebook Github

If you are trying to use a program to connect to MySQL (in my case, BugTracker, and you encounter the following problem:

Host 'localhost.localdomain' is not allowed to connect to this MySQL server.

This means that the program is trying to use TCP connections rather than sockets, despite using localhost as a configuration option. This is ridiculous, especially in a PHP environment, but we can easily get past it.

In the /etc/hosts file, make sure you have the following line:

/etc/hosts

127.0.0.1    localhost

It CANNOT be:

127.0.0.1    localhost.localdomain    localhost

This fixed my problem.