-6

I get the error when trying to run rails db:schema:dump

Ric$ rails db:schema:dump
  rails aborted!
  Mysql2::Error::ConnectionError: Access denied for user 'rails_user'@'localhost' (using password: NO)
  /Users/ricardosilva/.rvm/gems/ruby-2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect'
  /Users/ricardosilva/.rvm/gems/ruby-2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize'
  /Users/ricardosilva/.rvm/gems/ruby-2.6.0/gems/activerecord-5.2.2/lib/active_record

I have tried as well rails server and it doesn't work too. Also tried to reinstall all packs - nothing.

I'm using OS X 10.14 on x86_6,4 brew 2.0.4, rails 5.2.2, ruby 2.6.0, mysql 8.0.15

Looking for an answer.

3
  • 2
    "Mysql2::Error::ConnectionError: Access denied for user 'rails_user'@'localhost' (using password: NO)" your database configuration is trying to use a user called "rails_user" to access the database but that user either doe not exist or cannot login with the credentials provided Commented Mar 13, 2019 at 15:59
  • 1
    Either add a MySQL user rails_user or set a different one in your database.yml. Commented Mar 13, 2019 at 16:22
  • Possible duplicate of Ruby on Rails MYSQL error Access denied for user 'root@localhost' Commented Mar 14, 2019 at 14:30

1 Answer 1

0

Login to your mysql and add user (rails_user). Then grant the user privileges to the database you have created for your application beacuse it may happen that you already have the user(rails_user) but the use does not have privileges to the database of your application. then go to database.yml and put the require credentials for user which is (rails_user).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.