12/31/2005

MySQL+Apache+php+phpMyAdmin

安裝MySQL-Client-5.0.16
# cd /usr/ports/databases/mysql50-client/
# make WITH_CHARSET=utf8 WITH_XCHARSET=all SKIP_DNS_CHECK=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes NO_CHECKSUM=yes install
# make clean
安裝MySQL-Server-5.0.16
# cd /usr/ports/databases/mysql50-server/
# make WITH_CHARSET=utf8 WITH_XCHARSET=all SKIP_DNS_CHECK=yes BUILD_OPTIMIZED=yes BUILD_STATIC=yes WITH_DB_DIR=/usr/local/mysql NO_CHECKSUM=yes install
# make clean
//變更權限
# chown -R mysql:mysql /usr/local/bin/mysql
//執行Mysql指令
# /usr/local/etc/rc.d/mysql-server.sh start
//讓開機時自動開啟Mysql
# ee /etc/rc.conf
//加入mysql_enable="yes"
//(建議重開機)
//更改Mysql的root密碼
# mysql
mysql> use mysql
mysql> UPDATE user SET password=password('密碼') WHERE user='root' ;
mysql> exit
安裝apache-2.2.0_4
# cd /usr/ports/www/apache22/
# make install clean
安裝mod_php5-5.1.1,1
# cd /usr/ports/www/mod_php5/
# make install clean
//更改設定
# ee /usr/local/etc/apache22/httpd.conf
//紫色粗體為增加部份
DirectoryIndex index.php index.html index.htm
//然後在底部加入
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
安裝php5-mysql-5.1.1
# cd /usr/ports/databases/php5-mysql/
# make install clean
安裝php5-extensions-1.0
/*不知道為什麼裝到ImageMagic都會出點小問題
如果有要使用到這東西的話建議先裝完ImageMagic在來裝php5-extensions*/
# cd /usr/ports/lang/php5-extensions/
//選取需要的項目
# make config
# make install clean
//啟動Apache
# /usr/local/sbin/apachectl start
//開機時自動執行Apache
# ee /etc/rc.conf
//加上apache22_enable="YES"
安裝phpMyAdmin

# wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.7.0-pl1.tar.gz
# tar xvfz phpMyAdmin-2.7.0-pl1.tar.gz -C /usr/local/www/apache22/data
//修改資料夾名稱
# cd /usr/local/www/apache22/data
# mv phpMyAdmin-2.7.0-pl1 phpMyAdmin
//phpMyAdmin網址為 http://your_ip/phpMyAdmin
//更改設定
# cd phpMyAdmin
# ee config.default.php

  • $cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
  • $cfg['Servers'][$i]['user'] = 'root'; // MySQL user
  • $cfg['Servers'][$i]['password'] = '密碼'; // MySQL password (only needed

沒有留言: