Installing xampp but phpmyadmin doesn't connect

99封情书 提交于 2019-12-12 02:26:30

问题


So I installed xampp on my Linux machine running Ubuntu 14.04LTS. Now all of a sudden turns out when I try to connect to phpmyadmin it refuses to connect. I have already installed mysql separately as well but it doesn't seem to work. Any workaround for this?

The error that I get is :

MySQL said: 

Cannot connect: invalid settings. Connection for controluser as defined in your configuration failed. phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Any reason why this happens and solution to it?


回答1:


  1. Go to http://localhost/security/ and then click on the link http://localhost/security/xamppsecurity.php.

  2. After that change password for superuser to 'root'.

    After that open your http://localhost/phpmyadmin/




回答2:


As per the comment by RiggsFolly I was running two instances of MySQL

So both mysql servers do end up messing with phpmyadmin and this is how you shutdown the external mysql server while using xampp's inbuilt mysql server to connect successfully using phpmyadmin:

  1. Use whichmysql to find the utility that is running

  2. Navigate to the directory where the external MySQL service is running:

    $ cd /usr/bin

    $ mysqladmin shutdown

This shuts down the MySQL service running if at all it is running.

$ sudo service mysql stop

This helps as well if at all it will tell you the status of the service if it is already shut down.

  1. Now we need to stop the Xampp mysql server so we navigate to /lampp/bin and again execute the same command to shut mysql server down.

    $ cd /opt/lampp/bin

    $ mysqladmin shutdown

  2. Simply restart xampp and you should be good to go.

    $ sudo /opt/lampp/lampp restart



来源:https://stackoverflow.com/questions/33573354/installing-xampp-but-phpmyadmin-doesnt-connect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!