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

前端 未结 27 1893
爱一瞬间的悲伤
爱一瞬间的悲伤 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:24

    It is because your system has two installations of "mysql" packages. One installation was made through xampp/lampp and another installation was made through mysql-debain package. To solve the problem, just go to "synaptic manager" and remove mysql, and then you will be able to access mysql from xampp server.

    Note : removing mysql from synaptic manager doesn't affect mysql which was installed through xampp/lampp server. So don't worry!

    0 讨论(0)
  • 2020-11-27 15:24

    I had an issue with the path of the MySQL service in the Windows 7 registry which was not changed with the new installed XAMPP or newer easyPHP version.

    So if anybody has the same problem (#2002 error, phpMyAdmin cannot be started) you can search into the win regedit for 'my.ini' and exchange the path to the new package.

    For example I exchanged on a few places the older path:

    C:\EASYPH~1.1VC\binaries\mysql\bin\eds-mysqld.exe --defaults-file=C:\EASYPH~1.1VC\binaries\mysql\my.ini MySQL

    with the newer one:

    c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql

    It is strange that nobody described this issue before on the web!

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题