Help us understand the problem. What is going on with this article?

MacのMySQLクライアント

bashの場合

brew install mysql --client-only
ということだったんですが。
Error: invalid option: --client-only
というエラーになってしまったので。

brew install mysql-client
になったということだったんですが、MySQLが出てこない……

メッセージに書いてありました。

echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile

ということで、上記を実施して、

source ~/.bash_profile

をすると使えるようになります。

zshになって

macOS Catalina(10.15)からデフォルトのシェルが zsh になって、勝手が変わりました。
システムからのメッセージも変わっています。

% brew install mysql-client

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

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

そんな訳で、
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
を実行して、
source ~/.zshrc
を実行。

ローカルDBに
% mysql -uroot -p -h127.0.0.1
で繋がりました✌

takepan
PC-8001の産湯をつかい、姓は車、名は寅次郎 人呼んでtakepanと発します
yyphp
PHPerが毎週集まり、ざっくばらんに情報交換する雑談コミュニティ
https://yyphp.connpass.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした