質問編集履歴

3

mysql_config --socketの結果を追記した。

2021/10/18 22:41

投稿

yasshun1229
yasshun1229

スコア8

test CHANGED
File without changes
test CHANGED
@@ -156,123 +156,9 @@
156
156
 
157
157
  ```Ruby on Rails
158
158
 
159
- ActiveRecord::ConnectionNotEstablished (Access denied for user 'dbuser'@'localhost' (using password: YES)):
159
+ ubuntu:~/environment/message-board (main) $ mysql_config --socket
160
160
 
161
-
162
-
163
- activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:45:in `rescue in new_client'
164
-
165
- activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:39:in `new_client'
166
-
167
- activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
168
-
169
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
170
-
171
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
172
-
173
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
174
-
175
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
176
-
177
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
178
-
179
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
180
-
181
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
182
-
183
- activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
184
-
185
- activerecord (6.1.4.1) lib/active_record/connection_handling.rb:327:in `retrieve_connection'
186
-
187
- activerecord (6.1.4.1) lib/active_record/connection_handling.rb:283:in `connection'
188
-
189
- activerecord (6.1.4.1) lib/active_record/migration.rb:611:in `connection'
190
-
191
- activerecord (6.1.4.1) lib/active_record/migration.rb:606:in `build_watcher'
192
-
193
- activerecord (6.1.4.1) lib/active_record/migration.rb:588:in `block in call'
194
-
195
- activerecord (6.1.4.1) lib/active_record/migration.rb:587:in `synchronize'
196
-
197
- activerecord (6.1.4.1) lib/active_record/migration.rb:587:in `call'
198
-
199
- actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
200
-
201
- activesupport (6.1.4.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
202
-
203
- actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
204
-
205
- actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
206
-
207
- actionpack (6.1.4.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
208
-
209
- actionpack (6.1.4.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
210
-
211
- web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
212
-
213
- web-console (4.1.0) lib/web_console/middleware.rb:19:in `block in call'
214
-
215
- web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
216
-
217
- web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
218
-
219
- actionpack (6.1.4.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
220
-
221
- railties (6.1.4.1) lib/rails/rack/logger.rb:37:in `call_app'
222
-
223
- railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `block in call'
224
-
225
- activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
226
-
227
- activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:37:in `tagged'
228
-
229
- activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `tagged'
230
-
231
- railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `call'
232
-
233
- sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
234
-
235
- actionpack (6.1.4.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
236
-
237
- actionpack (6.1.4.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
238
-
239
- rack (2.2.3) lib/rack/method_override.rb:24:in `call'
240
-
241
- rack (2.2.3) lib/rack/runtime.rb:22:in `call'
161
+ /var/run/mysqld/mysqld.sock
242
-
243
- activesupport (6.1.4.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
244
-
245
- actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
246
-
247
- actionpack (6.1.4.1) lib/action_dispatch/middleware/static.rb:24:in `call'
248
-
249
- rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
250
-
251
- actionpack (6.1.4.1) lib/action_dispatch/middleware/host_authorization.rb:92:in `call'
252
-
253
- rack-mini-profiler (2.3.3) lib/mini_profiler/profiler.rb:393:in `call'
254
-
255
- webpacker (5.4.3) lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
256
-
257
- rack-proxy (0.7.0) lib/rack/proxy.rb:63:in `call'
258
-
259
- railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
260
-
261
- puma (5.5.2) lib/puma/configuration.rb:249:in `call'
262
-
263
- puma (5.5.2) lib/puma/request.rb:77:in `block in handle_request'
264
-
265
- puma (5.5.2) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
266
-
267
- puma (5.5.2) lib/puma/request.rb:76:in `handle_request'
268
-
269
- puma (5.5.2) lib/puma/server.rb:447:in `process_client'
270
-
271
- puma (5.5.2) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
272
-
273
- Started GET "/" for 106.72.177.65 at 2021-10-18 22:37:07 +0000
274
-
275
- Cannot render console from 106.72.177.65! Allowed networks: 127.0.0.0/127.255.255.255, ::1
276
162
 
277
163
  ```
278
164
 

2

mysql_config --socket の結果と database.yml を載せたこと

2021/10/18 22:41

投稿

yasshun1229
yasshun1229

スコア8

test CHANGED
File without changes
test CHANGED
@@ -104,6 +104,178 @@
104
104
 
105
105
 
106
106
 
107
+ database.yml
108
+
109
+ ```database.yml
110
+
111
+ default: &default
112
+
113
+ adapter: mysql2
114
+
115
+ encoding: utf8mb4
116
+
117
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
118
+
119
+ username: dbuser
120
+
121
+ password: dbpass
122
+
123
+ socket: /var/run/mysqld/mysqld.sock
124
+
125
+
126
+
127
+ development:
128
+
129
+ <<: *default
130
+
131
+ database: message_board_development
132
+
133
+
134
+
135
+ test:
136
+
137
+ <<: *default
138
+
139
+ database: message_board_test
140
+
141
+
142
+
143
+ production:
144
+
145
+ <<: *default
146
+
147
+ database: message_board_production
148
+
149
+ username: message_board
150
+
151
+ password: <%= ENV['MESSAGE_BOARD_DATABASE_PASSWORD'] %>
152
+
153
+ ```
154
+
155
+ mysql_config --socketの結果
156
+
157
+ ```Ruby on Rails
158
+
159
+ ActiveRecord::ConnectionNotEstablished (Access denied for user 'dbuser'@'localhost' (using password: YES)):
160
+
161
+
162
+
163
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:45:in `rescue in new_client'
164
+
165
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:39:in `new_client'
166
+
167
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
168
+
169
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
170
+
171
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
172
+
173
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
174
+
175
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
176
+
177
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
178
+
179
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
180
+
181
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
182
+
183
+ activerecord (6.1.4.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
184
+
185
+ activerecord (6.1.4.1) lib/active_record/connection_handling.rb:327:in `retrieve_connection'
186
+
187
+ activerecord (6.1.4.1) lib/active_record/connection_handling.rb:283:in `connection'
188
+
189
+ activerecord (6.1.4.1) lib/active_record/migration.rb:611:in `connection'
190
+
191
+ activerecord (6.1.4.1) lib/active_record/migration.rb:606:in `build_watcher'
192
+
193
+ activerecord (6.1.4.1) lib/active_record/migration.rb:588:in `block in call'
194
+
195
+ activerecord (6.1.4.1) lib/active_record/migration.rb:587:in `synchronize'
196
+
197
+ activerecord (6.1.4.1) lib/active_record/migration.rb:587:in `call'
198
+
199
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
200
+
201
+ activesupport (6.1.4.1) lib/active_support/callbacks.rb:98:in `run_callbacks'
202
+
203
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
204
+
205
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
206
+
207
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
208
+
209
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
210
+
211
+ web-console (4.1.0) lib/web_console/middleware.rb:132:in `call_app'
212
+
213
+ web-console (4.1.0) lib/web_console/middleware.rb:19:in `block in call'
214
+
215
+ web-console (4.1.0) lib/web_console/middleware.rb:17:in `catch'
216
+
217
+ web-console (4.1.0) lib/web_console/middleware.rb:17:in `call'
218
+
219
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
220
+
221
+ railties (6.1.4.1) lib/rails/rack/logger.rb:37:in `call_app'
222
+
223
+ railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `block in call'
224
+
225
+ activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `block in tagged'
226
+
227
+ activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:37:in `tagged'
228
+
229
+ activesupport (6.1.4.1) lib/active_support/tagged_logging.rb:99:in `tagged'
230
+
231
+ railties (6.1.4.1) lib/rails/rack/logger.rb:26:in `call'
232
+
233
+ sprockets-rails (3.2.2) lib/sprockets/rails/quiet_assets.rb:13:in `call'
234
+
235
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
236
+
237
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/request_id.rb:26:in `call'
238
+
239
+ rack (2.2.3) lib/rack/method_override.rb:24:in `call'
240
+
241
+ rack (2.2.3) lib/rack/runtime.rb:22:in `call'
242
+
243
+ activesupport (6.1.4.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
244
+
245
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
246
+
247
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/static.rb:24:in `call'
248
+
249
+ rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
250
+
251
+ actionpack (6.1.4.1) lib/action_dispatch/middleware/host_authorization.rb:92:in `call'
252
+
253
+ rack-mini-profiler (2.3.3) lib/mini_profiler/profiler.rb:393:in `call'
254
+
255
+ webpacker (5.4.3) lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
256
+
257
+ rack-proxy (0.7.0) lib/rack/proxy.rb:63:in `call'
258
+
259
+ railties (6.1.4.1) lib/rails/engine.rb:539:in `call'
260
+
261
+ puma (5.5.2) lib/puma/configuration.rb:249:in `call'
262
+
263
+ puma (5.5.2) lib/puma/request.rb:77:in `block in handle_request'
264
+
265
+ puma (5.5.2) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
266
+
267
+ puma (5.5.2) lib/puma/request.rb:76:in `handle_request'
268
+
269
+ puma (5.5.2) lib/puma/server.rb:447:in `process_client'
270
+
271
+ puma (5.5.2) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
272
+
273
+ Started GET "/" for 106.72.177.65 at 2021-10-18 22:37:07 +0000
274
+
275
+ Cannot render console from 106.72.177.65! Allowed networks: 127.0.0.0/127.255.255.255, ::1
276
+
277
+ ```
278
+
107
279
  #試したこと
108
280
 
109
281
  ググったりしてみましたが、出てきませんでした。l
@@ -120,4 +292,4 @@
120
292
 
121
293
  ・Rails 6.1.3.1
122
294
 
123
- ・GitHub
295
+ ・GitHub.yml

1

初心者マークを付けたこと

2021/10/18 22:39

投稿

yasshun1229
yasshun1229

スコア8

test CHANGED
File without changes
test CHANGED
@@ -106,7 +106,7 @@
106
106
 
107
107
  #試したこと
108
108
 
109
- ググったりしてみましたが、出てきませんでした。
109
+ ググったりしてみましたが、出てきませんでした。
110
110
 
111
111
 
112
112