###発生している問題
Ruby on Railsの開発環境を構築する中でmysqlを使えるようにしています。
まず、mysqlのコマンドを使えるようにするために、次のコマンドを実行しました。
sudo export PATH=/usr/local/opt/mysql@5.6/bin:$PATH
このあと、Macのパスワードを入力すると、
sudo: export: command not found
と返ってきて先へ進めません。
本来は、このあとwhich mysql
を実行し、
/usr/local/opt/mysql@5.6/bin/mysql
と返ってくることを期待しています。
###試したこと
mysqlを入れ直してみようと思い、brew uninstall mysql56
を実行したあと、
brew install mysql56
を実行しました。その結果が以下のようになります。
Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae annie
==> Downloading https://homebrew.bintray.com/bottles/mysql@5.6-5.6.40.high_sierra.bottle.tar.gz Already downloaded: /Users/ユーザー名/Library/Caches/Homebrew/mysql@5.6-5.6.40.high_sierra.bottle.tar.gz ==> Pouring mysql@5.6-5.6.40.high_sierra.bottle.tar.gz ==> Caveats A "/etc/my.cnf" from another install may interfere with a Homebrew-built server starting up correctly.
MySQL is configured to only allow connections from localhost by default
To connect: mysql -uroot
This formula 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 this software first in your PATH run: echo 'export PATH="/usr/local/opt/mysql@5.6/bin:$PATH"' >> ~/.bash_profile
・・・(*)
For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/mysql@5.6/lib CPPFLAGS: -I/usr/local/opt/mysql@5.6/include
To restart mysql@5.6 after an upgrade: brew services restart mysql@5.6 Or, if you don't want/need a background service you can just run: /usr/local/opt/mysql@5.6/bin/mysql.server start ==> Summary ???? /usr/local/Cellar/mysql@5.6/5.6.40: 339 files, 154.3MB
環境は Mac OS X High Sierra 10.13.6です。
(*)が関係している気もしたのですが、コマンドのことはまだ勉強中ですので、何が原因でこのような事態になっているかをお教えいただけると幸いです。
ご回答よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/25 12:25
2018/07/25 13:22 編集