This error message usually appears, when mysql server is not running.
Restarting MySQL server simply solves the problem.
Solution for Windows
Solution for Linux
Run the "mysqld" command in Terminal and it will start the MySQL server.
Viewing Details: