The above given is a simple error which shows that the user don’t have access to login from the console but this can turn into a nightmare if you were able to login a couple of moments ago and now you are getting this error. After a couple of moment when you enter a command show databases and you only get test database and nothing else, you will certainly knock your head in the wall. but keep calm take a deep breath, think twice and then shutdown the MySQL Server.
Go to /etc/my.cnf