phpMyAdmin is throwing a #2002 cannot log in to the mysql server phpmyadmin

前端 未结 27 2346
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 14:50

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

27条回答
  •  情话喂你
    2020-11-27 15:25

    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.

提交回复
热议问题