the error message is telling you the application cannot connect to the database
that could be down to anyone of a number of reasons. the most likely is going to be an incorrect userid + password or insufficient permissions for that userid for the requested actions
1) the db isn't active ... check the server is running
..first off check the server is running on the computer that MySQL is installed, what you are seeking to prove is the server is active and able to receive connection requests. how you do that depends on what machine the server is running on, what access you have to it and so on.
..asssuming the server is active
2) check you can talk to the server from another application (try downloading 3rd party software such as MySQL Workbench, or anyone of the many other tools such as HeidiSQL, PHPMyAdmin, modelling tools and the like) and see if you can connect to the server of the options Id strongly recommend you use workbench as it helps int he administration of the server. a problem here could be a firewall blocking connections for / from MySQL
3) check your code, make certain the userid & password are correct, make certain the host is correctly sepcified. investigate any error logs to see if they give a clue as to whats (not) happening
you don't give an indication of what language you are suing to connect to MySQL.