phpMyAdmin安裝完全攻略手記

   最近由於需要用到phpMyAdmin來管理服務器上的mysql數據庫,所以今天就學習了下如何安裝phpMyAdmin,順便也記錄下來以備後查。

 

一、軟件安裝包

1.httpd-2.2.6.tar.gz
2.php-5.2.5.tar.gz
3.phpMyAdmin-2.11.5.1-all-languages.tar.gz
4.php-mysqlnd-5.0.1-beta.tar.gz

 

二、安裝apache的httpd

#tar xf httpd-2.2.6.tar.gz
#cd httpd-2.2.6
#./configure --prefix=/usr/local/apache2 --enable-module=so
#make
#make install

 

三、安裝php5

#tar xf php-mysqlnd-5.0.1-beta.tar.gz
#tar xf php-5.2.5.tar.gz
#cd php-5.2.5
#rm -f -R ext/mysqli
#cp -R ../php-mysqlnd-5.0.1-beta/php5/ext/mysqli  ./ext/
#./buildconf --force
#./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/lib --enable-track-vars --with-xml --with-mysqli --enable-mysqlnd --with-mbstring --enable-mbstring=all
#make
#make install
#cp php.ini-dist /usr/local/lib/php.ini

 

四、安裝phpMyAdmin(假設安裝目錄在:/webapp/phpMyAdmin)

#tar xf phpMyAdmin-2.11.5.1-all-languages.tar.gz
#mv phpMyAdmin-2.11.5.1-all-languages /webapp/phpMyAdmin

 

五、配置apache的httpd.conf

#vi /usr/local/apache2/conf/httpd.conf
1)將DocumentRoot和Directory的目錄改爲:/webapp/phpMyAdmin
2)在DirectoryIndex中添加index.php
3)添加php的擴展類型:
  AddType application/x-httpd-php .php .phtml .php3 .inc
  AddType application/x-httpd-php-source .phps

 

六、配置phpMyAdmin

#cd /webapp/phpMyAdmin
#cp config.sample.inc.php config.inc.php
#vi config.inc.php


對如下的字段進行配置即可,沒有的可以自己添加:
$cfg['Servers'][$i]['auth_type'] = 'config';  // 認證模式,可以有cookie、http和config
$cfg['blowfish_secret'] = 'mabiqiang';  // 使用cookie方式認證的密碼短語
$cfg['Servers'][$i]['host'] = '127.0.0.1';  // 設置你的數據庫服務器的訪問IP
$cfg['Servers'][$i]['user'] = 'root';  // config認證模式時的訪問用戶名稱
$cfg['Servers'][$i]['password'] = 'root';  // config認證模式時的訪問密碼
$cfg['Servers'][$i]['connect_type'] = 'tcp';  // 連接方式,tcp(默認)或socket
$cfg['Servers'][$i]['extension'] = 'mysqli'; // MYSQL擴展,可以爲mysql和mysqli(推薦mysql4.1.0以上版本)
$cfg['Servers'][$i]['only_db'] = array('db1','db2'); // 只顯示指定的數據庫,字符串或數組

 

   以上是給出了phpMyAdmin的基本配置信息,具體的還需要根據個人的情況做適當的調整。另外,對於php5的安裝,我是使用了mysql官方提供的php-mysqlnd-5.0.1-beta.tar.gz,而沒有使用mysql-dev。前者是mysql官方最新推薦的php對mysql的訪問驅動,相比以前的,官方的解說如下:

 

Q: Is mysqlnd a new PHP extension?
No, the new MySQL driver for PHP is not a new PHP extension. The driver is a replacement for libmysql on the internal C level of the PHP extension ext/mysqli.

You can continue to compile the ext/mysqli extension with libmysql like ever since. We will not remove this functionality. Alternatively you can compile ext/mysqli with mysqlnd. We suggest that you try it, because mysqlnd is easier to compile and we found it to be faster than libmysql.

 

Q: Does it work with any MySQL Server before 4.1?

The MySQL native driver for PHP requires PHP 5 or PHP 6.

You can use it to connect to the MySQL Server 4.1 or newer.

 

Q: Can other PHP extensions use it?

Yes, they can, if they want to. The source code of the new driver is the ext/mysqli/mysqlnd directory of the download files. Extension writes will find that mysqlnd mimics the API of libmysql respectively the MySQL C API.

 

 

發佈了2 篇原創文章 · 獲贊 0 · 訪問量 3413
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章