Homebrew は macports より最近人気のある、*NIX系のアプリをインストールするのに便利な フレームワークです。
公式サイト: http://mxcl.github.com/homebrew/
Homebrew のインストールには 公式サイトに記載がありますが、
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
を実行するだけで 簡単にインストールされます。
Homebrew がインストールされた後は
mysql をインストールしてみます。
$ brew install mysql約8分でインストール完了です。
==> Installing mysql dependency: cmake
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.6
######################################################################## 100.0%
==> Pouring cmake-2.8.6.bottle.tar.gz
/usr/local/Library/Homebrew/download_strategy.rb:114: warning: conflicting chdir during another chdir block
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/cmake/2.8.6: 628 files, 28M
==> Installing mysql dependency: readline
==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file vi_mode.c
patching file callback.c
==> ./configure --prefix=/usr/local/Cellar/readline/6.2.1 --mandir=/usr/local/Ce
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.
OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
Generally there are no consequences of this for you.
If you build your own software and it requires this formula, you'll need
to add its lib & include paths to your build variables:
LDFLAGS -L/usr/local/Cellar/readline/6.2.1/lib
CPPFLAGS -I/usr/local/Cellar/readline/6.2.1/include
==> Summary
/usr/local/Cellar/readline/6.2.1: 28 files, 1.6M, built in 24 seconds
==> Installing mysql dependency: pidof
==> Downloading http://www.nightproductions.net/downloads/pidof_source.tar.gz
######################################################################## 100.0%
==> make all
==> /usr/bin/gzip pidof.1
/usr/local/Cellar/pidof/0.1.4: 2 files, 20K, built in 2 seconds
==> Installing mysql
==> Downloading http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.15.tar.g
######################################################################## 100.0%
==> Patching
patching file scripts/mysqld_safe.sh
Hunk #1 succeeded at 555 (offset 172 lines).
patching file scripts/mysql_config.sh
Hunk #1 succeeded at 137 (offset 5 lines).
patching file configure.cmake
==> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.15 -DMYSQL_DATADI
==> make
==> make install
==> Caveats
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html
To run as, for instance, user "mysql", you may need to `sudo`:
sudo mysql_install_db ...options...
Start mysqld manually with:
mysql.server start
Note: if this fails, you probably forgot to run the first two steps up above
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To launch on startup:
* if this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
* if this is an upgrade and you already have the com.mysql.mysqld.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
You may also need to edit the plist to use the correct "UserName".
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/mysql/5.5.15: 6276 files, 217M, built in 8.1 minutes
すごく簡単にインストールされました。
今回は 実施しませんが、
起動時に mysql も一緒に起動させるには
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
と実行します。
0 件のコメント:
コメントを投稿