その1ではIIS7.5をCUIからセットアップしました。次はMySQLをセットアップしてみましょう。
MySQL Commynity Serverをセットアップする
まず、「Download Community Server」からお使いのプラットフォーム(x86/x64)にあわせてダウンロードしましょう。Windows Server 2008 R2からは64bit環境ですので、Windows (x86,64Bit)MSI版をダウンロードしましょう。MySQLのインストールではGUIで二つのステップに分かれています。
- バイナリのインストール
- DBインスタンスの初期作成と設定
ここではmsiexecを使ってc:\mysql\へインストールしています、同じくデータの保存先もc:\mysql\としました。
msiexec.exe /i mysql-essential-5.1.45-winx64.msi /quiet INSTALLDIR="c:\mysql\" DATADIR="c:\mysql\"
次に、インストール先のMySQLInstanceConfig.exeを使って、初期インスタンスを作成しましょう。
c:\mysql\bin\MySQLInstanceConfig.exe -i -q "-lc:\mysql\install_log.txt" "-nMySQL" "-pc:\mysql\" "-tc:\mysql\my-template.ini" "-cc:\mysql\my.ini" ServerType=SERVER DatabaseType=MIXED ConnectionUsage=DSS Port=3306 RootPassword=password Charset=utf8 AddBinToPath=yes StrictMode=no
GUIでインスタンス作成のウィザードを実行した事がある方は、それぞれのオプションの値を見ると「あぁ、ウィザードのここの部分だな」と、ピンとくる部分があると思います。オプションは以下のようになってます。
MySQLInstanceConfig:
To use the Instance Configuration Wizard from the command line the following parameters can be used.
These parameters have to be set to run from the command line
-n<product name>
-p<path of installation> (no \bin)
-v<version>
Actions to perform
-i (install instance)
-r (remove instance)
-s (stop instance)
-q (be quiet)
-lfilename (write log file)
When launched manually, these can also be submitted
-t<.cnf template filename>
-c<.cnf filename>
Use the following option to define the parameters for the config file generation.
ServiceName=$
AddBinToPath={yes | no}
ServerType={DEVELOPMENT | SERVER | DEDICATED}
DatabaseType={MIXED | INNODB | MYISAM}
ConnectionUsage={DSS | OLTP}
ConnectionCount=#
SkipNetworking={yes | no}
Port=#
StrictMode={yes | no}
Charset=$
RootPassword=$
RootCurrentPassword=$
The return codes of the Wizard in case of an error are.
2 ... Configuration template file cannot be found.
3 ... The Windows service entry cannot be created.
4 ... Could not connect to the Service Control Manager.
5 ... The MySQL service cannot be started.
6 ... The MySQL service cannot be stopped.
7 ... The security settings cannot be applied.
8 ... The configuration file cannot be written.
9 ... The Windows service entry cannot be removed.
各オプションの値について詳しく説明したい所ですが、それぞれの設定で出力されたmy.iniを比較したり、MySQLのチューニングについて調べてみてください。
次回はPHPのインストールについて触れたいと思います。



