Mysql – Unusual issue with localhost:3000 after watching ruby on rails 4 tutorial: Lynda.com

MySQL

I'm totally new to programming, and I've started my training by watching the ruby on rails 4 essential training tutorial at lynda.com. I got to the section where I was supposed to create a web server by first opening the code in my database.yml file, then entering my password for mysql, then starting a server by typing "rails server" in the command line. It didn't work at localhost:3000. I tried granting privileges to the databases in mysql to the account, and I even tried changing the password, but it still doesn't work. When I go to localhost:3000, it still says : Access denied for user 'root'@'localhost' (using password: NO).

Also, I have a host name written in the code, but no socket. I don't know if this changes anything, I may just have a newer version of mysql than the guy in the video.

Here is the code:

# MySQL.  Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem 'mysql2'
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql2
  encoding: utf8
  database: #my_cms_development
  pool: 5
  username: root
  password: snapple187
  host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql2
  encoding: utf8
  database: my_cms_test
  pool: 5
  username: root
  password: snapple187  
  host: localhost

production:
  adapter: mysql2
  encoding: utf8
  database: #my_cms_production
  pool: 5
  username: root
  password: snapple187 
  host: localhost

Thank you for taking the time to help solve this issue.

Best Answer

This is how I have always set up my rails projects, using SQLite in your test and development will save you this heartache!

#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: mysql2
  encoding: utf8
  database: #your db name
  username: #your db username
  password: #your db password
  host: #your db hostname
  port: 3306