質問編集履歴
7
エラーコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -270,4 +270,14 @@
|
|
270
270
|
rake aborted!
|
271
271
|
Mysql2::Error::ConnectionError: Can't connect to MySQL server on 'db' (111 "Connection refused")
|
272
272
|
|
273
|
+
```
|
274
|
+
|
275
|
+
# 追記
|
276
|
+
|
277
|
+
```ここに言語を入力
|
278
|
+
~@yk golfour_aws % docker-compose run web rails db:migrate
|
279
|
+
Starting golfour_aws_db_1 ... done
|
280
|
+
Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"exec\": executable file not found in $PATH": unknown
|
281
|
+
|
282
|
+
|
273
283
|
```
|
6
タイトルを編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -192,6 +192,8 @@
|
|
192
192
|
# 追記
|
193
193
|
|
194
194
|
|
195
|
+
docker-composed.yml:
|
196
|
+
|
195
197
|
``` docker-composed.yml
|
196
198
|
version: '3'
|
197
199
|
services:
|
@@ -226,6 +228,9 @@
|
|
226
228
|
|
227
229
|
```
|
228
230
|
|
231
|
+
|
232
|
+
database.yml:
|
233
|
+
|
229
234
|
``` database.yml
|
230
235
|
default: &default
|
231
236
|
adapter: mysql2
|
5
タイトルを編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -192,7 +192,7 @@
|
|
192
192
|
# 追記
|
193
193
|
|
194
194
|
|
195
|
-
```docker-composed.yml
|
195
|
+
``` docker-composed.yml
|
196
196
|
version: '3'
|
197
197
|
services:
|
198
198
|
db:
|
@@ -226,7 +226,7 @@
|
|
226
226
|
|
227
227
|
```
|
228
228
|
|
229
|
-
```database.yml
|
229
|
+
``` database.yml
|
230
230
|
default: &default
|
231
231
|
adapter: mysql2
|
232
232
|
encoding: utf8
|
4
エラーコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -255,4 +255,14 @@
|
|
255
255
|
password: <%= ENV['DB_PASSWORD'] %>
|
256
256
|
host: <%= ENV['DB_HOSTNAME'] %>
|
257
257
|
|
258
|
+
```
|
259
|
+
|
260
|
+
```ここに言語を入力
|
261
|
+
~@yk golfour_aws % docker-compose run web bundle exec rake db:create
|
262
|
+
Starting golfour_aws_db_1 ... done
|
263
|
+
Can't connect to MySQL server on 'db' (111 "Connection refused")
|
264
|
+
Couldn't create 'golfour_development' database. Please check your configuration.
|
265
|
+
rake aborted!
|
266
|
+
Mysql2::Error::ConnectionError: Can't connect to MySQL server on 'db' (111 "Connection refused")
|
267
|
+
|
258
268
|
```
|
3
mysqlエラーを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -187,4 +187,72 @@
|
|
187
187
|
Couldn't create 'golfour_test' database. Please check your configuration.
|
188
188
|
rake aborted!
|
189
189
|
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
190
|
+
```
|
191
|
+
|
192
|
+
# 追記
|
193
|
+
|
194
|
+
|
195
|
+
```docker-composed.yml
|
196
|
+
version: '3'
|
197
|
+
services:
|
198
|
+
db:
|
199
|
+
image: mysql:8.0
|
200
|
+
command: --default-authentication-plugin=mysql_native_password
|
201
|
+
environment:
|
202
|
+
MYSQL_ROOT_PASSWORD: password
|
203
|
+
MYSQL_DATABASE: golfour_development
|
204
|
+
MYSQL_USER: yuki
|
205
|
+
MYSQL_PASSWORD: password
|
206
|
+
TZ: Asia/Tokyo
|
207
|
+
volumes:
|
208
|
+
- ./mysql/mysql_data:/var/lib/mysql
|
209
|
+
- ./logs:/var/log/mysql
|
210
|
+
- ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
|
211
|
+
ports:
|
212
|
+
- "4306:3306"
|
213
|
+
web:
|
214
|
+
build:
|
215
|
+
context: .
|
216
|
+
dockerfile: Dockerfile
|
217
|
+
command: /bin/sh -c "rm -f /workdir/tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
|
218
|
+
tty: true
|
219
|
+
stdin_open: true
|
220
|
+
depends_on:
|
221
|
+
- db
|
222
|
+
ports:
|
223
|
+
- "3000:3000"
|
224
|
+
volumes:
|
225
|
+
- .:/workdir
|
226
|
+
|
227
|
+
```
|
228
|
+
|
229
|
+
```database.yml
|
230
|
+
default: &default
|
231
|
+
adapter: mysql2
|
232
|
+
encoding: utf8
|
233
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
234
|
+
|
235
|
+
development:
|
236
|
+
<<: *default
|
237
|
+
database: golfour_development
|
238
|
+
username: yuki
|
239
|
+
password: password
|
240
|
+
host: db
|
241
|
+
socket: /tmp/mysql.sock
|
242
|
+
|
243
|
+
test:
|
244
|
+
<<: *default
|
245
|
+
database: golfour_test
|
246
|
+
host: db
|
247
|
+
username: yuki
|
248
|
+
password: password
|
249
|
+
socket: /tmp/mysql.sock
|
250
|
+
|
251
|
+
production:
|
252
|
+
<<: *default
|
253
|
+
database: <%= ENV['DB_NAME'] %>
|
254
|
+
username: <%= ENV['DB_USERNAME'] %>
|
255
|
+
password: <%= ENV['DB_PASSWORD'] %>
|
256
|
+
host: <%= ENV['DB_HOSTNAME'] %>
|
257
|
+
|
190
258
|
```
|
2
mysqlエラーを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -175,4 +175,16 @@
|
|
175
175
|
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
176
176
|
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
177
177
|
|
178
|
+
```
|
179
|
+
|
180
|
+
# 追記
|
181
|
+
|
182
|
+
```ここに言語を入力
|
183
|
+
~@yk golfour_aws % docker-compose run web bundle exec rake db:create
|
184
|
+
Starting golfour_aws_db_1 ... done
|
185
|
+
Database 'golfour_development' already exists
|
186
|
+
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
187
|
+
Couldn't create 'golfour_test' database. Please check your configuration.
|
188
|
+
rake aborted!
|
189
|
+
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
|
178
190
|
```
|
1
ログを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -153,4 +153,26 @@
|
|
153
153
|
# 文字コードの設定
|
154
154
|
default-character-set = utf8mb4
|
155
155
|
|
156
|
+
```
|
157
|
+
|
158
|
+
# 追記
|
159
|
+
```ここに言語を入力
|
160
|
+
~@yk golfour_aws % docker-compose ps
|
161
|
+
Name Command State Ports
|
162
|
+
------------------------------------------------------------------------------------
|
163
|
+
golfour_aws_db_1 docker-entrypoint.sh mysqld Exit 1
|
164
|
+
golfour_aws_web_1 /bin/sh -c rm -f /workdir/ ... Up 0.0.0.0:3000->3000/tcp
|
165
|
+
|
166
|
+
~@yk golfour_aws % docker-compose logs db
|
167
|
+
Attaching to golfour_aws_db_1
|
168
|
+
db_1 | 2020-08-16 12:54:40+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
169
|
+
db_1 | 2020-08-16 12:54:41+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
170
|
+
db_1 | 2020-08-16 12:54:41+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
171
|
+
db_1 | 2020-08-16 12:55:16+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
172
|
+
db_1 | 2020-08-16 12:55:17+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
173
|
+
db_1 | 2020-08-16 12:55:17+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
174
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
175
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
|
176
|
+
db_1 | 2020-08-16 13:01:38+09:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.21-1debian10 started.
|
177
|
+
|
156
178
|
```
|