前言
CentOs安裝配置phpMyAdmin其實(shí)非常簡(jiǎn)單,所謂的安裝其實(shí)是不存在的,因?yàn)閜hpMyAdmin是php寫(xiě)的嘛,所以只需要下載安裝包然后解壓之后,簡(jiǎn)單配置下就可以使用了,下面給他家說(shuō)下如何正確配置phpMyAdmin
安裝:
1、首先在phpMyAdmin官方網(wǎng)站 http://www.phpmyadmin.net/downloads下載源碼包,或者通過(guò)腳本之家進(jìn)行下載://www.jb51.net/codes/405261.html ,下載后上傳到服務(wù)器解壓即可,或者通過(guò)Linux命令來(lái)下載安裝(推薦)
2、下載phpMyAdmin安裝包
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.0/phpMyAdmin-4.6.0-all-languages.tar.gz
3、解壓文件
tar zxvf phpMyAdmin-4.6.0-all-languages.tar.gz
4、將phpMyAdmin-4.6.0-all-languages放到web目錄下
mv phpMyAdmin-4.6.0-all-languages /usr/local/nginx/html
5、重新命名
mv phpMyAdmin-4.6.0-all-languages phpMyAdmin
配置:
cd /usr/local/nginx/html/phpMyAdmin/libraries
vim config.default.php
1、修改以下3處地方
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
報(bào)錯(cuò):
mysqli_real_connect(): (HY000/2002): No such file or directorymysqli_real_connect(): (HY000/2002): No such file or directory
解決方法:
把phpmyadmin目錄中的配置文件config.sample.inc.php改成config.inc.php。并且修改以下:
$cfg['Servers'][$i]['host'] = 'localhost';
#改成
$cfg['Servers'][$i]['host'] = '127.0.0.1';
再次刷新頁(yè)面就不會(huì)出現(xiàn)mysqli_real_connect(): (HY000/2002): No such file or directory
的錯(cuò)誤提示了。
訪問(wèn):
本項(xiàng)目在放在 nginx 測(cè)試目錄html下,在瀏覽器中輸入 ip:/phpMyAdmin,然后輸入用戶名、密碼即可。
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,如果有疑問(wèn)大家可以留言交流,謝謝大家對(duì)腳本之家的支持。