今回お聞きしたいことは、MySQLをhomebrewで導入する際にどうやって初回ログインしルートユーザーにパスワードを設定するかです。
実は以下のコマンドで一度ログイン出来ましたが、
quitしてもう一度ログインしようとしたら出来なくなっていました。
色々試行錯誤している間に変なコマンドを叩いてなければいいのですが…
$ brew services start mysql ==> Successfully started `mysql` (label: homebrew.mxcl.mysql) $ mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.21 Homebrew Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
ところがもう一度同じコマンドを叩いてみると以下のような結果になります。
$ mysql -uroot ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
これを質問すると以下のコマンドでログをみればいいということで、叩いて見た結果がこちらです。
$ sudo cat /usr/local/var/mysql/私のMacBook-Air.local.err | grep password Password: 2018-02-12T16:21:35.895834Z 0 [Note] Shutting down plugin 'sha256_password' 2018-02-12T16:21:35.895843Z 0 [Note] Shutting down plugin 'mysql_native_password' 〜中略〜 2018-02-14T15:25:23.324310Z 0 [Note] Shutting down plugin 'sha256_password' 2018-02-14T15:25:23.324325Z 0 [Note] Shutting down plugin 'mysql_native_password' 2018-02-15T14:32:30.407314Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO) 2018-02-15T14:32:53.173475Z 3 [Note] Access denied for user 'root'@'localhost' (using password: YES) 2018-02-15T14:33:07.135263Z 4 [Note] Access denied for user 'root'@'localhost' (using password: YES) 2018-02-15T14:33:32.184931Z 5 [Note] Access denied for user 'root'@'localhost' (using password: NO)
どういう風に対処すればよろしいでしょうか?
また
$ brew services start mysql
ではなく
$ mysql.server start
でサーバーを立ち上げても似たようなことが起こります。この二つにはどういう違いがあるのでしょうか?

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/21 14:30
2018/02/21 14:32
退会済みユーザー
2018/02/21 15:20
2018/02/22 11:41
退会済みユーザー
2018/02/22 11:46
2018/02/22 14:21
2018/02/22 14:22
2018/02/22 16:24 編集
2018/02/24 09:34
2018/02/24 09:42
2018/02/24 09:54
2018/02/24 09:58 編集
2018/02/24 10:05
2018/02/24 10:14
2018/02/24 13:51