回答編集履歴
1
間違えました。
answer
CHANGED
@@ -1,30 +1,1 @@
|
|
1
|
-
### 「find / -name "my.cnf" -ls 2>/dev/null」とコマンドを打つと、my.cnfと言うファイルを探しに行きます(時間が掛かります)。
|
2
|
-
```bash
|
3
|
-
nandymak$ find / -name "my.cnf" -ls 2>/dev/null
|
4
|
-
3586232 8 -rw-r--r-- 1 nandymak admin 212 9 19 19:43 /usr/local/etc/my.cnf
|
5
|
-
7830222 8 -rw-r--r-- 1 nandymak staff 145 6 27 04:02 /usr/local/Cellar/mysql/8.0.17_1/.bottle/etc/my.cnf
|
6
|
-
7819521 8 -rw-r--r-- 1 nandymak staff 113 12 21 2018 /usr/local/Cellar/mysql@5.6/5.6.43/.bottle/etc/my.cnf
|
7
|
-
nandymak$
|
8
|
-
```
|
9
|
-
|
10
|
-
### そこで見つかったmy.cnfの中身をすべて確認してください。上記の例であれば
|
11
|
-
```bash
|
12
|
-
$ cat /usr/local/etc/my.cnf | grep caching_sha2_password
|
13
|
-
$ cat /usr/local/Cellar/mysql/8.0.17_1/.bottle/etc/my.cnf | grep caching_sha2_password
|
14
|
-
$ cat /usr/local/Cellar/mysql@5.6/5.6.43/.bottle/etc/my.cnf | grep caching_sha2_password
|
15
|
-
```
|
16
|
-
|
17
|
-
### 上記の結果、以下の文字列が見つかったら、修正します。
|
18
|
-
```bash
|
19
|
-
default_authentication_plugin=caching_sha2_password
|
20
|
-
```
|
21
|
-
↓以下のように修正する。「=」の後ろです。
|
22
|
-
```bash
|
23
|
-
default_authentication_plugin=mysql_native_password
|
24
|
-
```
|
25
|
-
|
26
|
-
|
1
|
+
間違えて書き込んでしまいました。
|
27
|
-
```bash
|
28
|
-
$ brew services restart mysql@5.6
|
29
|
-
$ mysql -uroot
|
30
|
-
```
|