I have installed MySQL server enterprise 5.1 on my local machine and now I want to install phpMyAdmin, but it does not work.
I have unrared phpMyAdmin to my server r
It happened with me when I changed the instance type of my AWS server.
#2002 Cannot log in to the MySQL server can also occur when the mysqld service is not started.
So first of all you need to execute :
$ sudo service mysqld restart
This will give you :
$ sudo service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
After that the error will not come.
P.S. On EC2 instances, one should also change the host from localhost to 127.0.0.1 as mentioned in the top answer.