CentOS安裝phpMyAdmin

來源:互聯網
上載者:User

標籤:

一、離線安裝

1,下載phpmyadmin
下載網址:http://www.phpmyadmin.net/home_page/downloads.php
phpmyadmin 3.x版本要求php5.2以上,mysql5.0以上,對號入座。如果選錯了,出現的問題就難解決了。

2,安裝phpmyadmin
解壓 tar xvfz phpMyAdmin-3.5.2.2-all-languages.tar.gz,

並將檔案夾複製到網站主目錄/var/www/html/

3,配置phpmyadmin
I. config.sample.inc.php更名為config.inc.php;
II. 開啟config.inc.php檔案,進行以下修改;
// $cfg[‘Servers‘][$i][‘controluser‘] = ‘pma’;
// $cfg[‘Servers‘][$i][‘controlpass‘] = ‘pmapass’;
// $cfg[‘Servers‘][$i][‘pmadb‘] = ‘phpmyadmin’;
// $cfg[‘Servers‘][$i][‘bookmarktable‘] = ‘pma_bookmark’;
// $cfg[‘Servers‘][$i][‘relation‘] = ‘pma_relation’;
// $cfg[‘Servers‘][$i][‘table_info‘] = ‘pma_table_info’;
// $cfg[‘Servers‘][$i][‘table_coords‘] = ‘pma_table_coords’;
// $cfg[‘Servers‘][$i][‘pdf_pages‘] = ‘pma_pdf_pages’;
// $cfg[‘Servers‘][$i][‘column_info‘] = ‘pma_column_info’;
// $cfg[‘Servers‘][$i][‘history‘] = ‘pma_history’;
// $cfg[‘Servers‘][$i][‘designer_coords‘] = ‘pma_designer_coords’;
去掉每行前面的//;

III.$cfg[‘blowfish_secret‘] = ”; |修改為| $cfg[‘blowfish_secret‘] = ‘http’;
IV.$cfg[‘Servers‘][$i][‘controluser‘] = ‘pma’; |把’pma’修改為你的帳號|$cfg[‘Servers‘][$i][‘controlpass‘] = ‘pmapass’; |把’pmapass設定為你的mysql登入密碼|
V. $cfg[‘blowfish_secret‘] = ”; | 添加短語密碼例如:$cfg[‘blowfish_secret‘] = ‘onohot’;

您可以根據訪問phpMyAdmin http://ip/phpmyadmin/管理資料庫:

 

二、通過yum安裝

通過yum安裝phpMyAdmin及配置過程
1. 安裝mysql + php環境。
2. 安裝phpMyAdmin
yum -y install phpMyAdmin

安裝完成後如下配置:
因為使用yum安裝,配置略有不同
phpmyadmin預設安裝在、usr/share/phpmyadmin 把phpmyadmin拷貝到web目錄下:
[[email protected] ~]# chown -R root:apache /var/www/phpmyadmin/
[[email protected] ~]# vi /etc/httpd/conf.d/phpmyadmin.conf 建立供Apache調用的phpMyAdmin設定檔
Alias /phpmyadmin /var/www/phpmyadmin
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.0

這裡只允許本機和192.168.0.0網段的主機訪問,如果允許外網使用者,則配置為:

Alias /phpmyadmin /var/www/phpmyadmin
Order deny,allow
Allow from all


[[email protected] ~]# /etc/rc.d/init.d/httpd restart 重新啟動HTTP服務,使以上設定生效
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

CentOS安裝phpMyAdmin

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.