質問編集履歴
4
追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -126,4 +126,20 @@
|
|
126
126
|
|
127
127
|
"MYSQL_VERSION=5.7.30-1debian10"
|
128
128
|
|
129
|
+
|
130
|
+
|
131
|
+
~ docker-machine env default
|
132
|
+
|
133
|
+
export DOCKER_TLS_VERIFY="1"
|
134
|
+
|
135
|
+
export DOCKER_HOST="tcp://192.168.99.100:2376"
|
136
|
+
|
137
|
+
export DOCKER_CERT_PATH="/Users/cacao86/.docker/machine/machines/default"
|
138
|
+
|
139
|
+
export DOCKER_MACHINE_NAME="default"
|
140
|
+
|
141
|
+
# Run this command to configure your shell:
|
142
|
+
|
143
|
+
# eval $(docker-machine env default)
|
144
|
+
|
129
145
|
```
|
3
追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,4 +50,80 @@
|
|
50
50
|
|
51
51
|
07ee0f26247b mysql:5.7 "docker-entrypoint.s…" 9 hours ago Up 9 hours 0.0.0.0:3306->3306/tcp, 33060/tcp container_name
|
52
52
|
|
53
|
+
|
54
|
+
|
55
|
+
local内のMySQL
|
56
|
+
|
57
|
+
mysql> select user, host from user;
|
58
|
+
|
59
|
+
+---------------+-----------+
|
60
|
+
|
61
|
+
| user | host |
|
62
|
+
|
63
|
+
+---------------+-----------+
|
64
|
+
|
65
|
+
| mysql.session | localhost |
|
66
|
+
|
67
|
+
| mysql.sys | localhost |
|
68
|
+
|
69
|
+
| root | localhost |
|
70
|
+
|
71
|
+
+---------------+-----------+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
docker内のMySQL
|
76
|
+
|
77
|
+
+---------------+-----------+
|
78
|
+
|
79
|
+
| user | host |
|
80
|
+
|
81
|
+
+---------------+-----------+
|
82
|
+
|
83
|
+
| root | % |
|
84
|
+
|
85
|
+
| user_name | 127.0.0.1 |
|
86
|
+
|
87
|
+
| mysql.session | localhost |
|
88
|
+
|
89
|
+
| mysql.sys | localhost |
|
90
|
+
|
91
|
+
| root | localhost |
|
92
|
+
|
93
|
+
+---------------+-----------+
|
94
|
+
|
95
|
+
SHOW GRANTS FOR user_name@127.0.0.1;
|
96
|
+
|
97
|
+
+------------------------------------------------------------------------------+
|
98
|
+
|
99
|
+
| Grants for user_name@127.0.0.1 |
|
100
|
+
|
101
|
+
+------------------------------------------------------------------------------+
|
102
|
+
|
103
|
+
| GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'127.0.0.1' WITH GRANT OPTION |
|
104
|
+
|
105
|
+
+------------------------------------------------------------------------------+
|
106
|
+
|
107
|
+
user_name@'%'にして同じように権限を与えても接続できませんでした。
|
108
|
+
|
53
109
|
```
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
```
|
114
|
+
|
115
|
+
07ee0f26247bのENVです
|
116
|
+
|
117
|
+
"Env": [
|
118
|
+
|
119
|
+
"MYSQL_ROOT_PASSWORD=password",
|
120
|
+
|
121
|
+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
122
|
+
|
123
|
+
"GOSU_VERSION=1.12",
|
124
|
+
|
125
|
+
"MYSQL_MAJOR=5.7",
|
126
|
+
|
127
|
+
"MYSQL_VERSION=5.7.30-1debian10"
|
128
|
+
|
129
|
+
```
|
2
追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -37,3 +37,17 @@
|
|
37
37
|
MySQL5.7
|
38
38
|
|
39
39
|
Mac catalina
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
### 追記
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
~ docker ps
|
48
|
+
|
49
|
+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
50
|
+
|
51
|
+
07ee0f26247b mysql:5.7 "docker-entrypoint.s…" 9 hours ago Up 9 hours 0.0.0.0:3306->3306/tcp, 33060/tcp container_name
|
52
|
+
|
53
|
+
```
|
1
質問文を編集しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,8 @@
|
|
24
24
|
|
25
25
|
user_name@127.0.0.1にアクセスしたいと思っているのですがuser_name@localhostでアクセスしようとしてしまいます。
|
26
26
|
|
27
|
+
Docker内からmysql -u user_name -h 127.0.0.1 -pではログインに成功します。
|
28
|
+
|
27
29
|
解決策やアドバイスなどがあればご教授お願いいたします!
|
28
30
|
|
29
31
|
|