LoginSignup
0
0

More than 3 years have passed since last update.

MySQL5.7のインストール

Last updated at Posted at 2020-06-15

これがめちゃくちゃ参考になった。
https://weblabo.oscasierra.net/mysql-57-homebrew-install/

asatokensei@MacBook-Air memopy % brew install mysql@5.7
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
benthos        broot          clojure        exploitdb      freetds        inxi           jc             mutt           phpstan        terragrunt     wtf            yq

==> Downloading https://homebrew.bintray.com/bottles/mysql%405.7-5.7.29.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/bf/bf0cdc294df996455c8abad3e03b6691f2145a4036085ad2570ec6c993e6b9c0?__gda__=exp=1592203912~hmac=7b0c7f804ecbf5c35cb08f36b76cf74de21f31f
######################################################################## 100.0%
==> Pouring mysql@5.7-5.7.29.catalina.bottle.tar.gz
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH run:
  echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
  export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
  export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"

For pkg-config to find mysql@5.7 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/mysql@5.7/lib/pkgconfig"


To have launchd start mysql@5.7 now and restart at login:
  brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mysql@5.7/bin/mysql.server start
==> Summary
🍺  /usr/local/Cellar/mysql@5.7/5.7.29: 319 files, 232.3MB

パスを見てみる。↓

asatokensei@MacBook-Air memopy % which mysql           
/usr/local/opt/mysql@5.7/bin/mysql

パスが合ってなかったらパスを通す。
今回は合ってたのでスルー。
詳しくはこの記事↓
https://weblabo.oscasierra.net/mysql-57-homebrew-install/

バージョン見ると、、、

asatokensei@MacBook-Air memopy % mysql --version
mysql  Ver 14.14 Distrib 5.7.29, for osx10.15 (x86_64) using  EditLine wrapper

ちゃんとできてる!

以下のエラーが出る人へ

asatokensei@MacBook-Air memopy % mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Air.pid).

この記事を↓
https://qiita.com/kenkeeeenbbt/items/bf7045c5ca433a4ac342

0
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
0
0