質問編集履歴

1

回答者からの回答による確認結果追記

2018/10/02 02:24

投稿

ambN
ambN

スコア13

test CHANGED
File without changes
test CHANGED
@@ -20,6 +20,12 @@
20
20
 
21
21
 
22
22
 
23
+ <追記>
24
+
25
+ t_obaraさんよりいただいたURLの結果を追加しました。
26
+
27
+
28
+
23
29
  ### 発生している問題・エラーメッセージ
24
30
 
25
31
 
@@ -141,3 +147,163 @@
141
147
  f2e1877a8d62 bbs_db "docker-entrypoint.s…" 11 seconds ago Up 8 seconds 33060/tcp, 0.0.0.0:3309->3306/tcp bbs_mysql
142
148
 
143
149
  ```
150
+
151
+
152
+
153
+ <追記>
154
+
155
+ **1. 外部サーバーへpingコマンドを叩く**
156
+
157
+ ```
158
+
159
+ >ping 127.0.0.1
160
+
161
+
162
+
163
+ 127.0.0.1 に ping を送信しています 32 バイトのデータ:
164
+
165
+ 127.0.0.1 からの応答: バイト数 =32 時間 <1ms TTL=128
166
+
167
+ 127.0.0.1 からの応答: バイト数 =32 時間 <1ms TTL=128
168
+
169
+ 127.0.0.1 からの応答: バイト数 =32 時間 <1ms TTL=128
170
+
171
+ 127.0.0.1 からの応答: バイト数 =32 時間 <1ms TTL=128
172
+
173
+
174
+
175
+ 127.0.0.1 の ping 統計:
176
+
177
+ パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、
178
+
179
+ ラウンド トリップの概算時間 (ミリ秒):
180
+
181
+ 最小 = 0ms、最大 = 0ms、平均 = 0ms
182
+
183
+ ```
184
+
185
+ ⇒返答あり
186
+
187
+
188
+
189
+ **2. 外部サーバーに直接ログインし、サーバー上でMySQLにアクセス**
190
+
191
+ ```
192
+
193
+ mysql> show variables like 'port';
194
+
195
+ +---------------+-------+
196
+
197
+ | Variable_name | Value |
198
+
199
+ +---------------+-------+
200
+
201
+ | port | 3306 |
202
+
203
+ +---------------+-------+
204
+
205
+ 1 row in set (0.01 sec)
206
+
207
+ mysql> select host, user from mysql.user;
208
+
209
+ +-----------+------------------+
210
+
211
+ | host | user |
212
+
213
+ +-----------+------------------+
214
+
215
+ | % | root |
216
+
217
+ | % | user |
218
+
219
+ | localhost | mysql.infoschema |
220
+
221
+ | localhost | mysql.session |
222
+
223
+ | localhost | mysql.sys |
224
+
225
+ | localhost | root |
226
+
227
+ +-----------+------------------+
228
+
229
+ 6 rows in set (0.00 sec)
230
+
231
+ ```
232
+
233
+ ⇒portが3306なのは、コンテナ内なので問題なしのはず。。
234
+
235
+  ユーザーも、root@%がいるためアクセス可能のはず。。
236
+
237
+
238
+
239
+ **3. /etc/mysql/my.cnfの確認**
240
+
241
+ ```
242
+
243
+ root@f2e1877a8d62:/etc/mysql# cat my.cnf
244
+
245
+ # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
246
+
247
+ #
248
+
249
+ # This program is free software; you can redistribute it and/or modify
250
+
251
+ # it under the terms of the GNU General Public License as published by
252
+
253
+ # the Free Software Foundation; version 2 of the License.
254
+
255
+ #
256
+
257
+ # This program is distributed in the hope that it will be useful,
258
+
259
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
260
+
261
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
262
+
263
+ # GNU General Public License for more details.
264
+
265
+ #
266
+
267
+ # You should have received a copy of the GNU General Public License
268
+
269
+ # along with this program; if not, write to the Free Software
270
+
271
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
272
+
273
+
274
+
275
+ #
276
+
277
+ # The MySQL Server configuration file.
278
+
279
+ #
280
+
281
+ # For explanations see
282
+
283
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
284
+
285
+
286
+
287
+ [mysqld]
288
+
289
+ pid-file = /var/run/mysqld/mysqld.pid
290
+
291
+ socket = /var/run/mysqld/mysqld.sock
292
+
293
+ datadir = /var/lib/mysql
294
+
295
+ secure-file-priv= NULL
296
+
297
+ # Disabling symbolic-links is recommended to prevent assorted security risks
298
+
299
+ symbolic-links=0
300
+
301
+
302
+
303
+ # Custom config should go here
304
+
305
+ !includedir /etc/mysql/conf.d/
306
+
307
+ ```
308
+
309
+ ⇒bind-addressの記載なし。自分で作成したmy.cnfにも記載していない状態。