2011/04/11

phpMyAdmin

【Red Hat Enterprise Linux】
yum install phpmyadmin
cp  /usr/share/phpmyadmin/config.sample.inc.php  /usr/share/phpmyadmin/config.inc.php
cat  /etc/httpd/conf.d/phpmyadmin.conf

【Ubuntu】
apt-get install phpmyadmin

【tarball】

新版的 phpMyAdmin 需要 PHP 5.2 以上的環境。

大致流程是:
1. 安裝 HTTP Server 與 PHP 環境
2. 下載最新版的 phpMyAdmin
3. 解壓縮到 HTTP Server 的 Document Root
4. 編輯 phpMyAdmin 的 config.inc.php 檔
5. 連線 http://localhost/phpmyadmin 測試

# using Ubuntu + Apache + MySQL
sudo apt-get install apache2 mysql-server php5-mysql
cd /var/www
wget URL_of_phpMyAdmin_Source_Package.zip (http://www.phpmyadmin.net/home_page/downloads.php)
unzip phpMyAdmin*.zip
mv phpMyAdmin* phpmyadmin
cd /var/www/phpmyadmin
cp config.sample.inc.php config.inc.php
vim config.inc.php

簡單的 config.inc.php 設定
$cfg['blowfish_secret'] = '123'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0; 

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';  // MySQL 主機的位址
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

Reference:
01. http://wiki.phpmyadmin.net/pma/Quick_Install
02. http://wiki.phpmyadmin.net/pma/Config