Access denied for user 'root'@'localhost' (using password: NO)
Often times when you've created a new ruby on rails application, or you've installed an existing one, you'll get this error when you try and use the site.
It can be a confusing error, because your config/database.yml file may clearly indicate a mysql username other than root, as well as a specific password to use. So why is it trying to login as root, and without a password?
Most often this is because you need to restart the mongrel process after you make any changes to database.yml. To do this:
- Login to Virtualmin
- Click
Services - Click
Bootup Actions - Click the check box beside your mongrel instance
- Click the
Restart Selectedbutton
Hopefully that will do it. If not, here are a couple other things to check:
- Ensure that your mongrel process is configured to run your rails application in the correct mode, whether that be
developmentorproductionmode. - You might want to check that there aren't any tabs in your
database.ymlfile - Ensure there aren't any spaces prior to the
development:orproduction:lines in yourdatabase.ymlfile