LoginSignup
1
0

More than 5 years have passed since last update.

MySQLをMacにいれる時の手順

Last updated at Posted at 2017-09-27

MacBook Pro に MySQL をインストールしてみたので手順をメモ。

前提

  • ローカルの環境(Mac)に MySQL をインストールします。
    • 今回の OS X のバージョンは OS X 10.12.6 (Serra) です。
  • Homebrew でインストールします。
    • Homebrew自体が入ってなければ、Homebrewの公式ページどおり、次のようにインストール
      $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
      ※ 執筆時とコマンド内容が変わってるかもしれないので、公式ページを確認ください。 ※ 事前に Xcode のインストール(および起動して許諾への同意)が必要

手順

MySQL のインストール

// brewのアップデート
$ brew update
Updated 1 tap (homebrew/core).
==> New Formulae
libbitcoin-node
==> Updated Formulae
・・・・
// MySQLをインストール
$ brew install mysql
==> Installing dependencies for mysql: openssl
==> Installing mysql dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
==> Caveats

・・・・・

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

To have launchd start mysql now and restart at login:
  brew services start mysql
Or, if you don't want/need a background service you can just run:
  mysql.server start
==> Summary
  /usr/local/Cellar/mysql/5.7.19: 322 files, 233MB

インストール完了。どうやらインストールログを見ると起動方法とログイン方法(コマンド)が書いてある。
MySQLの起動:mysql.server start
ログイン方法:mysql -uroot

MySQLの起動

$ mysql.server start
Starting MySQL
. SUCCESS! 

MySQLにログイン

$ mysql -uroot
inokoichi@localhost:~$ mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 Homebrew
・・・・・・

接続完了。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0