• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

 私物のMacBook AirにMySQLをインストールしました。せっかくなので手順をメモしておきます。

 インストール自体はHomebrewでコマンド一発です。

   1  $ brew install mysql
   2  Warning: It appears you have MacPorts or Fink installed.
   3  Software installed with other package managers causes known problems for
   4  Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
   5  ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/mysql-5.6.1
   6  ######################################################################## 100.0%
   7  ==> Pouring mysql-5.6.15.mavericks.bottle.tar.gz
   8  ==> Caveats
   9  A "/etc/my.cnf" from another install may interfere with a Homebrew-built
  10  server starting up correctly.
  11  
  12  To connect:
  13      mysql -uroot
  14  
  15  To have launchd start mysql at login:
  16      ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
  17  Then to load mysql now:
  18      launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  19  Or, if you don't want/need launchctl, you can just run:
  20      mysql.server start
  21  ==> /usr/local/Cellar/mysql/5.6.15/bin/mysql_install_db --verbose --user=akanuma
  22  ==> Summary
  23   /usr/local/Cellar/mysql/5.6.15: 9410 files, 349M

 インストール後の各手順については上記のインストール時の出力に示されています。
 まずOS起動時にMySQLが起動するように設定します。

   1  $ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
   2  /Users/akanuma/Library/LaunchAgents/homebrew.mxcl.mysql.plist -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plist

 launchctlコマンドで起動します。

   1  $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 
   2  $ ps aux | grep mysql
   3  akanuma          2558   0.0  0.0  2423468    332 s000  R+   10:54PM   0:00.00 grep mysql
   4  akanuma          2555   0.0  5.3  3081112 448512   ??  S    10:54PM   0:00.40 /usr/local/Cellar/mysql/5.6.15/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.15 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.15/lib/plugin --bind-address=127.0.0.1 --log-error=/usr/local/var/mysql/Hiroakis-MacBook-Air.local.err --pid-file=/usr/local/var/mysql/Hiroakis-MacBook-Air.local.pid
   5  akanuma          2467   0.0  0.0  2436436   1008   ??  S    10:54PM   0:00.02 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --bind-address=127.0.0.1

 mysqlコマンドで接続できることを確認します。

   1  $ mysql -uroot
   2  Welcome to the MySQL monitor.  Commands end with ; or \g.
   3  Your MySQL connection id is 1
   4  Server version: 5.6.15 Homebrew
   5  
   6  Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   7  
   8  Oracle is a registered trademark of Oracle Corporation and/or its
   9  affiliates. Other names may be trademarks of their respective
  10  owners.
  11  
  12  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

posted by Png akanuma on Tue 10 Dec 2013 at 23:15
Contents
[MySQL] MacにMySQLをインストール
Comments
yoku0825: nkfの方が使いやすいですが、glibcに含まれているiconvの方が 確実にどの環境にも入っ... '12-6
Hiroaki Akanuma: ご指摘ありがとうございます。「嗜好度は大きい値がより嗜好度が強いことを意味すればどのような値で... '11-11
akr: 初めての推薦エンジンのところ 「属性データはどんなものでも可能。」 は preference ... '11-11
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ