mysql - Access denied for user 'user'@'localhost' (using password: NO)
This isn't a database problem at all. The tipoff is the "using password: NO" in the error message. Ensure that you're sending a password in your authentication as follows:

Command line

The correct syntax for the CLI client is:

$ mysql -uroot -ptest


Or you can just use -p (with no value), which will prompt you for a password. Note that there's no space between the flag (-u/-p) and the value (myuser/mypassword).

Rails

In your database.yml file, you should have:

adapter: mysql
database: my_db
hostname: 127.0.0.1
username: root
password: test
socket: /tmp/mysql.sock
pool: 5
timeout: 5000


Running rake db:create should now properly create your database.

See: ruby – How do I set up the database.yml file in Rails?