There are a variety of reasons why this can happen, and rather than spell them all out with the hopes that one...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
will stick, I'll refer you to http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html in the MySQL Online Reference Manual.
In a nutshell, make sure the server is running, make sure the post is not firewalled, and if connecting with unix sockets, make sure the socket file has permissions for writing.
Dig Deeper on Linux servers
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.