質問編集履歴

2

お手本サイトの方法を追記

2021/01/05 14:09

投稿

kanou-shimon
kanou-shimon

スコア6

test CHANGED
File without changes
test CHANGED
@@ -108,120 +108,40 @@
108
108
 
109
109
 
110
110
 
111
- 2エラー分を全部見てみたが原因は不明
111
+ ### 追記
112
112
 
113
- ```
114
113
 
115
- $rake db:create RAILS_ENV=production --trace
116
114
 
117
- ** Invoke db:create (first_time)
115
+ お手本としたサイトの方法
118
116
 
119
- ** Invoke db:load_config (first_time)
117
+ [https://qiita.com/naoki_mochizuki/items/5a1757d222806cbe0cd1](https://qiita.com/naoki_mochizuki/items/5a1757d222806cbe0cd1)
120
118
 
121
- ** Invoke environment (first_time)
119
+ MySQLの設定
122
120
 
123
- ** Execute environment
124
-
125
- ** Execute db:load_config
126
-
127
- ** Execute db:create
128
-
129
- Access denied for user 'root'@'localhost' (using password: YES)
130
-
131
- Couldn't create 'zimotoai_app_production' database. Please check your configuration.
121
+ [naoki|protospace]$ vi config/database.yml
132
-
133
- rake aborted!
134
-
135
- Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)
136
-
137
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect'
138
-
139
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize'
140
-
141
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `new'
142
-
143
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:24:in `mysql2_connection'
144
-
145
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in `new_connection'
146
-
147
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `checkout_new_connection'
148
-
149
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in `try_to_checkout_new_connection'
150
-
151
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in `acquire_connection'
152
-
153
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in `checkout'
154
-
155
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in `connection'
156
-
157
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1119:in `retrieve_connection'
158
-
159
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_handling.rb:221:in `retrieve_connection'
160
-
161
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/connection_handling.rb:189:in `connection'
162
-
163
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/mysql_database_tasks.rb:8:in `connection'
164
-
165
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/mysql_database_tasks.rb:16:in `create'
166
-
167
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:126:in `create'
168
-
169
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:185:in `block in create_current'
170
-
171
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:479:in `block (2 levels) in each_current_configuration'
172
-
173
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:476:in `each'
174
-
175
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:476:in `block in each_current_configuration'
176
-
177
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:475:in `each'
178
-
179
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:475:in `each_current_configuration'
180
-
181
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/tasks/database_tasks.rb:184:in `create_current'
182
-
183
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3/lib/active_record/railties/databases.rake:39:in `block (2 levels) in <main>'
184
-
185
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
186
-
187
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
188
-
189
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
190
-
191
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
192
-
193
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
194
-
195
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
196
-
197
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
198
-
199
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
200
-
201
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
202
-
203
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
204
-
205
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
206
-
207
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
208
-
209
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
210
-
211
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
212
-
213
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
214
-
215
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
216
-
217
- /home/shimon/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
218
-
219
- /home/shimon/.rbenv/versions/2.6.3/bin/rake:23:in `load'
220
-
221
- /home/shimon/.rbenv/versions/2.6.3/bin/rake:23:in `<main>'
222
-
223
- Tasks: TOP => db:create
224
122
 
225
123
 
226
124
 
227
125
  ```
126
+
127
+ production:
128
+
129
+ <<: *default
130
+
131
+ database: mumu_production
132
+
133
+ username: root ここをrootに変更する
134
+
135
+   password: ここを空欄にする
136
+
137
+ ```
138
+
139
+
140
+
141
+ [naoki|mumu]$ sudo service mysqld start mysqldの起動
142
+
143
+ [naoki|mumu]$ ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
144
+
145
+ [naoki|mumu]$ rake db:create RAILS_ENV=production
146
+
147
+ [naoki|mumu]$ rake db:migrate RAILS_ENV=production

1

mysqlタグ追加

2021/01/05 14:09

投稿

kanou-shimon
kanou-shimon

スコア6

test CHANGED
File without changes
test CHANGED
File without changes