質問編集履歴

1

更新

2019/12/04 07:12

投稿

Chandler_Bing
Chandler_Bing

スコア673

test CHANGED
@@ -1 +1 @@
1
- LaravelからMySQLにアクセスできな
1
+ MySQLに変更したポートでアクセスできなかった???
test CHANGED
@@ -1,3 +1,5 @@
1
+ 現在laravelからMySQLに接続しようとしています。
2
+
1
3
  ```env
2
4
 
3
5
  DB_CONNECTION=mysql
@@ -16,13 +18,7 @@
16
18
 
17
19
 
18
20
 
19
- 上記のようにエンブファイルは設定されています。
20
-
21
- パスワド設定、ユーザー、データベース名は間違はありません
21
+ ト番号を3307してたせいで以下のエラーが出ておりました
22
-
23
-
24
-
25
- 以下rootユーザーで「root」パスワードでログインできます。
26
22
 
27
23
 
28
24
 
@@ -86,6 +82,262 @@
86
82
 
87
83
 
88
84
 
85
+ しかし、ポートは3307に変更しています。
86
+
87
+ ![イメージ説明](c70dd22bc648191ab4a6204b6e92e8d6.png)
88
+
89
+
90
+
91
+ 以下DBのiniファイルです。(一部抜粋)
92
+
93
+ ```# Example MySQL config file for small systems.
94
+
95
+ #
96
+
97
+ # This is for a system with little memory (<= 64M) where MySQL is only used
98
+
99
+ # from time to time and it's important that the mysqld daemon
100
+
101
+ # doesn't use much resources.
102
+
103
+ #
104
+
105
+ # You can copy this file to
106
+
107
+ # C:/xampp/mysql/bin/my.cnf to set global options,
108
+
109
+ # mysql-data-dir/my.cnf to set server-specific options (in this
110
+
111
+ # installation this directory is C:/xampp/mysql/data) or
112
+
113
+ # ~/.my.cnf to set user-specific options.
114
+
115
+ #
116
+
117
+ # In this file, you can use all long options that a program supports.
118
+
119
+ # If you want to know which options a program supports, run the program
120
+
121
+ # with the "--help" option.
122
+
123
+
124
+
125
+ # The following options will be passed to all MySQL clients
126
+
127
+ [client]
128
+
129
+ # password = your_password
130
+
131
+ port=3306//ここ??
132
+
133
+ socket="C:/xampp/mysql/mysql.sock"
134
+
135
+
136
+
137
+
138
+
139
+ # Here follows entries for some specific programs
140
+
141
+
142
+
143
+ # The MySQL server
144
+
145
+ default-character-set=utf8mb4
146
+
147
+ [mysqld]
148
+
149
+ port=3307//ここ?
150
+
151
+ socket="C:/xampp/mysql/mysql.sock"
152
+
153
+ basedir="C:/xampp/mysql"
154
+
155
+ tmpdir="C:/xampp/tmp"
156
+
157
+ datadir="C:/xampp/mysql/data"
158
+
159
+ pid_file="mysql.pid"
160
+
161
+ # enable-named-pipe
162
+
163
+ key_buffer=16M
164
+
165
+ max_allowed_packet=1M
166
+
167
+ sort_buffer_size=512K
168
+
169
+ net_buffer_length=8K
170
+
171
+ read_buffer_size=256K
172
+
173
+ read_rnd_buffer_size=512K
174
+
175
+ myisam_sort_buffer_size=8M
176
+
177
+ log_error="mysql_error.log"
178
+
179
+
180
+
181
+ # Change here for bind listening
182
+
183
+ # bind-address="127.0.0.1"
184
+
185
+ # bind-address = ::1 # for ipv6
186
+
187
+
188
+
189
+ # Where do all the plugins live
190
+
191
+ plugin_dir="C:/xampp/mysql/lib/plugin/"
192
+
193
+
194
+
195
+ # Don't listen on a TCP/IP port at all. This can be a security enhancement,
196
+
197
+ # if all processes that need to connect to mysqld run on the same host.
198
+
199
+ # All interaction with mysqld must be made via Unix sockets or named pipes.
200
+
201
+ # Note that using this option without enabling named pipes on Windows
202
+
203
+ # (via the "enable-named-pipe" option) will render mysqld useless!
204
+
205
+ #
206
+
207
+ # commented in by lampp security
208
+
209
+ #skip-networking
210
+
211
+ #skip-federated
212
+
213
+
214
+
215
+ # Replication Master Server (default)
216
+
217
+ # binary logging is required for replication
218
+
219
+ # log-bin deactivated by default since XAMPP 1.4.11
220
+
221
+ #log-bin=mysql-bin
222
+
223
+
224
+
225
+ # required unique id between 1 and 2^32 - 1
226
+
227
+ # defaults to 1 if master-host is not set
228
+
229
+ # but will not function as a master if omitted
230
+
231
+ server-id =1
232
+
233
+
234
+
235
+ # Replication Slave (comment out master section to use this)
236
+
237
+ #
238
+
239
+ # To configure this host as a replication slave, you can choose between
240
+
241
+ # two methods :
242
+
243
+ #
244
+
245
+ # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
246
+
247
+ # the syntax is:
248
+
249
+ #
250
+
251
+ # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
252
+
253
+ # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
254
+
255
+ #
256
+
257
+ # where you replace <host>, <user>, <password> by quoted strings and
258
+
259
+ # <port> by the master's port number (3306 by default).
260
+
261
+ #
262
+
263
+ # OR
264
+
265
+ #
266
+
267
+ # 2) Set the variables below. However, in case you choose this method, then
268
+
269
+ # start replication for the first time (even unsuccessfully, for example
270
+
271
+ # if you mistyped the password in master-password and the slave fails to
272
+
273
+ # connect), the slave will create a master.info file, and any later
274
+
275
+ # change in this file to the variables' values below will be ignored and
276
+
277
+ # overridden by the content of the master.info file, unless you shutdown
278
+
279
+ # the slave server, delete master.info and restart the slaver server.
280
+
281
+ # For that reason, you may want to leave the lines below untouched
282
+
283
+ # (commented) and instead use CHANGE MASTER TO (see above)
284
+
285
+ #
286
+
287
+ # required unique id between 2 and 2^32 - 1
288
+
289
+ # (and different from the master)
290
+
291
+ # defaults to 2 if master-host is set
292
+
293
+ # but will not function as a slave if omitted
294
+
295
+ #server-id = 2
296
+
297
+ #
298
+
299
+ # The replication master for this slave - required
300
+
301
+ #master-host = <hostname>
302
+
303
+ #
304
+
305
+ # The username the slave will use for authentication when connecting
306
+
307
+ # to the master - required
308
+
309
+ #master-user = <username>
310
+
311
+ #
312
+
313
+ # The password the slave will authenticate with when connecting to
314
+
315
+ # the master - required
316
+
317
+ #master-password = <password>
318
+
319
+ #
320
+
321
+ # The port the master is listening on.
322
+
323
+ # optional - defaults to 3306
324
+
325
+ #master-port = <port>
326
+
327
+ #
328
+
329
+ # binary logging - not required for slaves, but recommended
330
+
331
+ #log-bin=mysql-bin
332
+
333
+
334
+
335
+ コード
336
+
337
+ ```
338
+
339
+
340
+
89
- DB_HOSTには自自身を表すIPアドレスIipconfigから取得したIPアドレス試し入れてみましがだめです
341
+ 見てかる通りいくつかport=3306になっており表面的には3307に代わって実際は3306だっということですか??
90
-
342
+
91
- こがかしいいでしょ
343
+ 以前こ?としている「3307」の部分「3306」であるのが原因でMySQLが立ち上がらなったので「3307」に変更たという経緯があります