---------------------------
OS: Windows Vista Home Premium 32bit UAC(ユーザー アカウント制御)有効
WEBサーバ: Apache HTTP Server 2.2.17 / Win32 Binary including OpenSSL 0.9.8o
PHP: PHP-5.2.14-Win32
DBサーバ: MySQL Community Server 5.1.52 Windows (x86, 32-bit)
「Apache HTTP Server (httpd) 2.2.17 is the best available version」セクションより、
Win32 Binary including OpenSSL 0.9.8o (MSI Installer): httpd-2.2.17-win32-x86-openssl-0.9.8o.msi
をダウンロード。
---------------------------
「PHP 5.2.14」セクションの「Windows Binaries」サブセクションより、
PHP 5.2.14 zip package [10,281Kb] - 22 July 2010
をダウンロード。ダウンロード先ミラーは適当に。
---------------------------
MySQL
---------------------------
バージョン: 5.1.52
DLページ: http://www-jp.mysql.com/downloads/mysql/
DLファイル: mysql-5.1.52-win32.msi
「MySQL Community Server 5.1.52」セクションより、
「Select Platform」 セレクトボックスにて 「Microsoft Windows」を選択。
Windows (x86, 32-bit), MSI Installer (mysql-5.1.52-win32.msi) 5.1.52 106.0M
のDownloadをクリックするとログインを求められるが無視し、
» No thanks, just take me to the downloads! をクリックして
適当なミラーからダウンロード。
---------------------------
mysql-5.1.52-win32.msi を実行します。
---------------------------
[Next]
---------------------------
Typical
[Next]
---------------------------
[Install]
---------------------------
MySQL Enterprise ウィンドウが出たら
[Next]
[Next]
---------------------------
Configure the MySQL Server nowのチェックを外す
[Finish]
---------------------------
スタート > すべてのプログラム > MySQL > MySQL Server 5.1 > MySQL Server Instance Config Wizard を実行。
---------------------------
[Next]
---------------------------
Detailed Configuration
[Next]
---------------------------
Developer Machine
[Next]
---------------------------
Multifunctional Database
[Next]
---------------------------
InnoDB Tablespace Settings は変更しないで
[Next]
---------------------------
Decision Support (DSS)/OLAP
[Next]
---------------------------
Enable TCP/IP Networkingにチェック
Port Numberは3306
Enable Strict Modeにチェック
[Next]
---------------------------
Best Support For Multilingualism
[Next]
---------------------------
Install As Windows Serviceにチェック
Service Nameは適当にMySQL
Launch the MySQL Server automaticallyにチェック
Include Bin Directory in Windows PATHにチェック
[Next]
---------------------------
Modify Security Settingsにチェック
New root password:にrootのパスワードを入力
Confirm:にもう一度入力
Create An Anonymous Accountはチェックしない
[Next]
---------------------------
[Execute]
---------------------------
[Finish]
---------------------------
次にコマンドプロンプトを起動します。
以下を入力してください。
---------------------------
mysqladmin -u root -p PING
---------------------------
Enter password:と表示されたら、先ほどの工程で設定したrootのパスワードを入力します。
以下の表示が出ればMySQLは稼動しています。
---------------------------
mysqld is alive
---------------------------
PHPからの接続テスト用のDBとテーブルを作成します。
コマンドプロンプトに以下を入力してください。
---------------------------
mysql -u root -p
---------------------------
先ほど同様、rootのパスワードを求められるので入力します。
---------------------------
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29 to server version: 4.1.9-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
---------------------------
上記のようにmysql>となって入力待ちになるので、下記のSQL文をコピペし、Enterを押します。
---------------------------
CREATE DATABASE IF NOT EXISTS `test` DEFAULT CHARACTER SET utf8;
USE `test`;
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
`id` int(11) NOT NULL auto_increment,
`text` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `test` SET `text` = 'Hello ! ';
INSERT INTO `test` SET `text` = 'PHP and MySQL';
---------------------------
すると以下のようにQuery OK,...と出ていればokです。
---------------------------
mysql> CREATE DATABASE IF NOT EXISTS `test` DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
mysql> USE `test`;
Database changed
mysql> DROP TABLE IF EXISTS `test`;
Query OK, 0 rows affected, 1 warning (0.00 sec)