Reputation: 11
I'm new to Rails and when I try creating a new application like this:
$ rails new app_one -d mysql
It installs and everything works as expected. But, if I try to run it on a local server with MySQL enabled, it doesn't work.
> /Users/matthewpoplin/.rvm/gems/ruby-2.0.0-p0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Access denied for user 'root'@'localhost' (using password: NO) (Mysql2::Error)
I'm using Rails version 3.2.13, Ruby version 2.0.0p0, MySQL version 5.6.10, and Homebrew 0.9.4.
How can I fix this?
Upvotes: 1
Views: 140
Reputation: 7593
Have you made sure that all the username, password, etc. information for the database is correct in your Rails database.yml
file?
From looking at this line in your output:
Access denied for user 'root'@'localhost' (using password: NO)
it is possible that your password isn't set in the Rails database settings file. It might be a good idea to double-check your database.yml
settings file. (Or, perhaps, it could be an issue with the database username and password you are wanting to use.)
And a note for future reference: it might be good to use a different database user other than "root" in the future, when possible.
Upvotes: 2