Michael Lachine
Michael Lachine

Reputation: 11

Rails server Mysql2::Error

I'm brand new to developing and ruby on rails. I'm on Windows 7, have ruby 2.1.6, rails 4.2.3, MySQL 5.6.26, and Sublime Text 2 (2.0.2) installed. I'm following an online tutorial on lynda.com about ruby on rails 4 essentials and ran into a problem trying to connect with my localhost:3000 rails server. I'm getting this error every time.

Mysql2::Error (Access denied for user 'root'@'localhost' (using password: NO))

and then a whole bunch of lines of code in the command prompt I don't understand. I need some help sorting this out please!

Upvotes: 1

Views: 151

Answers (2)

Lorenzo Camaione
Lorenzo Camaione

Reputation: 525

The error is caused by wrong credentials. You must set database_name, user_name and password.

Upvotes: 1

Lorenzo Camaione
Lorenzo Camaione

Reputation: 525

Go to your_app/ config/database.yml and in username insert your MySQL username (ex. Root) and in password your MySQL password. Don't forget to fill also the field "database".

Upvotes: 1

Related Questions