LoginSignup
0
0

MySQLをインストールしようとしたらエラー出た

Posted at

Qiita初投稿です:writing_hand_tone1:

MySQLをインストールする

環境
macOS:Big Sur 11.4
Homebrew: 2.7.1
MySQL:5.7


まずはターミナルを起動。
MySQLをインストールするコマンドを実行します。

% brew install mysql@5.7

吐き出されたエラー

上のコマンド実行後、しばらくしてからこのようなエラーが出ました。

% brew install mysql@5.7
# ~省略~
Error: Xcode alone is not sufficient on Big Sur. Install the Command Line Tools: xcode-select --install

英語よわよわ人間なので翻訳

エラー:Big Sur ではXcodeだけでは十分ではありません。
コマンドラインツールをインストールします: xcode-select --install

xcode-selectというものが何なのかはよく分からないのですが、とりあえず言われた通りにインストールしてみました。


えいやっと

% xcode-select --install
# ~省略~
xcode-select: note: install requested for command line developer tools

翻訳

xcode-select: 注: コマンドライン開発者ツールのインストールが要求されました


おや?うまくいったんかなと思い、もう一度MySQLインストールコマンドを実行。

% brew install mysql@5.7
# ~省略~
Error: Xcode alone is not sufficient on Big Sur. Install the Command Line Tools: xcode-select --install

また同じエラーが出てしまいました:cry:

対処

もしかして、Xcodeをしばらく使ってなさすぎるせいでバージョンが古いのが原因?
と思い、ダメ元でアップデートをかけてみました。

% brew update
Installing from the API is now the default behaviour!
You can save space and time by running:
  brew untap homebrew/core
  brew untap homebrew/cask
Already up-to-date.

翻訳

APIからのインストールがデフォルトの動作になりました。
以下を実行すると、スペースと時間を節約できます。
brew untap homebrew/core
brew untap homebrew/cask
すでに最新です。

とりあえず最新にできたっぽい、、、?

3度目の正直でMySQLインストール実行

% brew install mysql@5.7

約1時間後↓↓
(こんな時間かかる???)

% brew install mysql@5.7
# ~省略~
==> Successfully started `mysql@5.7`

どうやらうまくいったようです:clap_tone1::sparkles:
あとはPWの設定やらをして、完了です。

さいごに

念の為、バージョン確認。

% mysql --version
mysql  Ver 14.14 Distrib 5.7.44, for osx10.16 (x86_64) using  EditLine wrapper

ちゃんとMySQL5.7がインストールされたようです。よかった、、、。

参考にさせていただきました:pray_tone1:
https://qiita.com/Qiita/items/c686397e4a0f4f11683d

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