How to Fix Mysql Error: Access denied for user

Well, here it goes, my first blog post. Let's kick it off with a MySQL error.

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

The issue surfaced after creating the first model in a Ruby on Rails app and then trying to start rails server in development. It turns out config/database.yml wasn’t set up with the right MySQL credentials. After saving this file with the correct username and password, and then restarting rails server, my website didn’t receive the error anymore.

Here are some related links for anyone with this kind of problem.

Created by: thomashalljr, 3 months ago, last updated: 2 months ago