🎉

【環境構築】mysql: command not found

2021/06/03に公開約1,000字

mysql: command not found

$mysql --version
mysql: command not found
$ brew install mysql
brew: command not found

Homebrewをインストール

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

成功したけど・・・

Warning: /~/homebrew/bin is not in your PATH.
==> Installation successful!

アンド😭

brew -v
-bash: brew: command not found

解決方法

export PATH="$PATH:/~/homebrew/bin" 

vi ~/.zshrc
# .bashrc または、.bash_profile

# 以下を追加して保存して閉じる
export PATH=/~/homebrew/bin:$PATH

# 設定を再読み込み(これでターミナル入るたびパス通さなくて済む)
echo "source ~/opt/anaconda3/etc/profile.d/conda.sh" >> ~/.zshrc
$brew -v
Homebrew 3.1.9
Homebrew/homebrew-core (git revision 7c5cef98411; last commit 2021-06-03)

解決

$mysql --version
mysql  Ver 8.0.25 for Linux on x86_64 (Homebrew)

参照

https://qiita.com/Naggi-Goishi/items/2c49ea50602ea80bf015
https://qiita.com/yoshinyan/items/38bc4e4a02a66acead91
https://chicog.me/articles/1/
https://qiita.com/ketaro-m/items/cba09f5e3f89bd8ed935

Discussion

ログインするとコメントできます