2015-11-06 70 views
0

所以我在運行Ubuntu 14.04LTS的Linux機器上安裝了xampp。現在突然間,當我嘗試連接到phpmyadmin時,它拒絕連接。我已經分別安裝了mysql,但似乎沒有工作。任何解決方法?安裝xampp但phpmyadmin無法連接

,我得到的錯誤是:

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.

任何之所以出現這種情況和解決方案呢?

+0

你嘗試使用mysql客戶端命令行進行連接? 您是否[在phpmyadmin中配置主機,端口,登錄名和密碼](https://wiki.phpmyadmin.net/pma/Config/Servers#host)? –

+2

2 MYSQL服務器不會在相同的端口上運行(通常爲3306),因此您很可能會連接到其他您的用戶標識不存在或其他密碼的MySQL服務器 – RiggsFolly

+0

爲我工作@RiggsFolly –

回答

0

按照註釋通過RiggsFolly我運行MySQL

的兩個實例,所以兩者的MySQL服務器也結束了與phpMyAdmin搞亂,這是你如何關閉外部mysql服務器,同時使用xampp的內置mysql服務器使用phpmyadmin成功連接:

  1. 使用whichmysql找到運行

  2. 導航到該目錄的效用外MySQL服務運行的位置:

    $ cd /usr/bin

    $ mysqladmin shutdown

這將關閉MySQL服務運行,如果它正在運行。

$ sudo service mysql stop 

這也有幫助,如果有的話它會告訴你服務的狀態,如果它已經關閉。

  • 現在,我們需要使我們瀏覽到/lampp/bin停止XAMPP MySQL服務器,並再次執行相同的命令來關閉MySQL服務器了。

    $ cd /opt/lampp/bin

    $ mysqladmin shutdown

  • 只需重新啓動XAMPP,你應該是好去。

    $ sudo /opt/lampp/lampp restart