user3814030
user3814030

Reputation: 1283

Mysql2::Error Access denied for user

I have some rails applications on my mac and they work just fine. I have just installed a new one that uses mysql2 gem, I am starting the server but when I am visiting the application I am getting an Access denied error. I am trying to follow this solution Mysql2::Error: Access denied for user 'test'@'localhost' to database 'depot_test' I am logging in as a root user but when I am trying to create a new database I am getting an access denied error.

Upvotes: 1

Views: 1111

Answers (1)

kalelc
kalelc

Reputation: 1527

Changes in your config / database.yml the user name root. test user does not exist in MySQL. I think in your development environment should look like:

Example

development:
  adapter: mysql2
  database: depot_test
  pool: 5
  host: localhost
  encoding: utf8
  username: test
  password:

Change username to root or create test user with privileges. Remember that Rails uses environments(test, development, production u other). In your case is depot_development or another name that is not equal to another environment.

I hope it helps you.

Upvotes: 1

Related Questions