質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Q&A

0回答

321閲覧

Mysql2::Error::ConnectionError: Access denied for user 'myapp'@'localhost' (using password: YES)のエラー

rikuou

総合スコア25

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

0グッド

0クリップ

投稿2020/11/23 14:18

railsを用いてwebサービス開発中です
完成したwebサービスをherokuを用いてデプロイしました

サービスページをみてみると、初期データであるseedデータが反映されていなかったので、以下のサイトを参考にしてseedデータを投入しようとしたとこmysqlのエラー

参考サイト
https://qiita.com/Masanori_N/items/a9b4ae00e3e153ecb2e6

rails db:seed_fu RAILS_ENV=production == Seed from /Users/username/Shinshu-Fiber/db/fixtures/masters.rb rake aborted! Mysql2::Error::ConnectionError: Access denied for user 'Shinshu_Fiber'@'localhost' (using password: YES)

上記のmysqlエラーを調べたところ以下のサイトが参考になったので、手順通り進めパスワードを変更しましたが、またしても同じエラーが発生してしまいました

参考サイト
https://qiita.com/naota7118/items/b62d71484e21d6739d68

database.yml # MySQL. Versions 5.5.8 and up are supported. # # Install the MySQL driver # gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem 'mysql2' # # And be sure to use new-style password hashing: # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html # default: &default adapter: mysql2 encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: password socket: /tmp/mysql.sock development: <<: *default database: Shinshu_Fiber_development # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: Shinshu_Fiber_test # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is # ever seen by anyone, they now have access to your database. # # Instead, provide the password as a unix environment variable when you boot # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database # for a full rundown on how to provide these environment variables in a # production deployment. # # On Heroku and other platform providers, you may have a full connection URL # available as an environment variable. For example: # # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" # # You can use this database configuration with: # # production: # url: <%= ENV['DATABASE_URL'] %> # production: <<: *default database: Shinshu_Fiber_production username: Shinshu_Fiber password: password

なにか解決策はあるでしょうか、また間違っている点などございましたらご教授お願いいたします

疑問点

password: passwordは password: "password" の文字列で囲まなくてもいいのでしょうか
わたしは囲っていません

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問