プロジェクトの途中からDBを変えたいのですが下記のようなエラーが出てしまい先に進めません。どなたかご教授いただけると幸いです!
Access denied for user 'root'@'localhost' (using password: YES) Couldn't create 'my_diction' database. Please check your configuration. rails aborted! Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)
rb
1# SQLite. Versions 3.8.0 and up are supported. 2# gem install sqlite3 3# 4# Ensure the SQLite 3 gem is defined in your Gemfile 5# gem 'sqlite3' 6# 7default: &default 8 adapter: mysql2 9 encoding: utf8 10 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 11 username: root 12 password: password # ← ここの欄が空白なので任意のパスワードを設定する 13 host: localhost 14 15development: 16 <<: *default 17 database: my_diction 18 19# Warning: The database defined as "test" will be erased and 20# re-generated from your development database when you run "rake". 21# Do not set this db to the same as development or production. 22test: 23 <<: *default 24 database: my_diction 25 26production: 27 <<: *default 28 database: my_diction 29
## 試したこと
passwordがnoの場合の対処法はいくつか載っており、password: password を追加しそこは解決できました。