phpMyAdmin出現找不到mysql擴充和Cannot log in to the MySQL server問題

來源:互聯網
上載者:User

標籤:

環境:Centos6.5,Apache2.4, PHP5.5, MySql5.6.

phpMyAdmin版本:https://files.phpmyadmin.net/phpMyAdmin/4.4.11/phpMyAdmin-4.4.11-english.zip

 

 

下載後直接放到網站根目錄,然後配置如下:

$cfg[‘Servers‘][$i][‘user‘] = ‘root‘;$cfg[‘Servers‘][$i][‘password‘] = ‘root‘;

然後儲存,開啟http://localhost/phpMyAdmin

 

 

出現找不到mysqli擴充的警告,然後安裝pdo和mysql擴充

yum --enablerepo=remi install php-pdo php-mysqli

警告資訊沒有再出現,但依然出現“Cannot log in to the MySQL server”,找了很久,找到的解決方案都是長篇大論的,但無一例外都不是問題的最終答案。

 

 

最終,最終找到了一篇只有寥寥幾行字的博文,文字平實但句句戳中要害,最終問題解決了,如下:

因為在 /etc/my.cnf 裡關閉了tcp方式,但是沒有改 phpmyadmin 的 config.inc.php 檔案裡面

$cfg[‘Servers‘][$i][‘socket‘] = ‘/tmp/mysql.sock‘;$cfg[‘Servers‘][$i][‘connect_type‘] = ‘socket‘;

並確認/tmp下是否存在mysqld.sock檔案,如果不存在,找到檔案的存在位置建立軟串連

 

至此,問題解決。

phpMyAdmin出現找不到mysql擴充和Cannot log in to the MySQL server問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.