データベースがあると何かと便利なので、とりあえず MySQL をセットアップしておきます。とりあえず、いろいろ作業をしていた関係なのか、FreeBSD の標準として入っているのかわかりませんが、以下のモジュールを削除しました。
# pkg_delete mysql-server-5.0.51a
# pkg_delete p5-DBD-mysql-4.006
# pkg_delete php5-mysql-5.2.5_1
# pkg_delete mysql-client-5.0.51a
実際に削除をしたかったのは、最後の項目 mysql-client-5.0.51a ですがそれを削除するためには上の3つが依存していた形になります。これが終わったあと、とりあえず make を実行します。
# cd /usr/ports/databases/mysql51-server
# make WITH_CHARSET=utf8
===> Vulnerability check disabled, database not found
You may use the following build options:
<snip>
コンパイルが終わったらインストールをします。
# make install
===> Installing for mysql-server-5.1.24_1
===> mysql-server-5.1.24_1 depends on shared library: mysqlclient.16 – found
===> Generating temporary packing list
<snip>
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/mysqld
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/mysql-server
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type ‘make deinstall’
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
http://www.mysql.com/
ひとまずインストールは完了です。起動時に動かすためには、 /etc/rc.conf で以下の項目を YES にしましょう。
mysql_enable=”Yes“
あと、MySQL を起動するのであれば以下のような形で。
# /usr/local/etc/rc.d/mysql-server start
一応、こんな感じですかね。ちなみに起動後に webmin を見てみたところ、きちんと認識をしていました。
とりあえず、Change Administration Password を選択して、データベース管理者のパスワードを変更しておきましょう。実際に運用していく上で、何か変更を加えていくかもしれませんが、基本のインストールはこんな感じでした。