LoginSignup
68
54

More than 5 years have passed since last update.

homebrewで入れたmysqlを8系から5系にダウングレードする

Last updated at Posted at 2018-07-22

WHY

MySQLを8系にアップグレードしたところ、mysql2 gemが入らなくなり、Railsが起動できなくなってしまったため。
Homebrew で MySQL を 5.7.22 から 8.0.11 にバージョンアップしたら Rails が動かなくなったので対処する

HOW

1. mysqlをアンインストールする
アンインストールの手順は以下の記事を参考にしてください。
MacでMySQL5.7をアンインストールする

2. MySQL 5系のインストール

$ brew search mysql

で、利用可能なフォーミュラを検索。
mysql@5.7があるのを確認して、

$ brew install mysql@5.7

インストールが完了したら、パスを通す。

$ echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile

以下で起動できればインストール成功!

$ mysql.server start

自動起動の設定もしておきましょう。

$ ln -sfv /usr/local/opt/mysql@5.7/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
68
54
1

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
68
54