Forum: Ruby on Rails mysql error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0c225e62bb0a3b0a48e7a2bd3ace03e8?d=identicon&s=25 Rohan Dey (rohandey)
on 2006-05-03 18:58
Hi,

    I am starting new on rails.

Tried my first example got this error

#28000Access denied for user 'root'@'localhost' (using password: NO)


Please do suggest as I am having this problem on one of my system but it
works fine on the other.Really confused.


Thanks
Rohan
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-03 19:14
(Received via mailing list)
rohan dey wrote:
> works fine on the other.Really confused.
What does your database.yml look like?  At a guess, I'd say that you
haven't got a password defined in it, and the database on one system
doesn't need one, but the other does.
0c225e62bb0a3b0a48e7a2bd3ace03e8?d=identicon&s=25 Rohan Dey (rohandey)
on 2006-05-03 19:17
Alex Young wrote:
> rohan dey wrote:
>> works fine on the other.Really confused.
> What does your database.yml look like?  At a guess, I'd say that you
> haven't got a password defined in it, and the database on one system
> doesn't need one, but the other does.

Thanks for the reply, please do look at this file


# MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
#   gem install mysql
# On MacOS X:
#   gem install mysql -- --include=/usr/local/lib
# On Windows:
#   There is no gem for Windows.  Install mysql.so from RubyForApache.
#   http://rubyforge.org/projects/rubyforapache
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql
  database: todo
  username: root
  password:root
  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: mysql
  database: Todo_test
  username: root
  password:
  host: localhost

production:
  adapter: mysql
  database: Todo_production
  username: root
  password:
  host: localhost
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-03 19:32
(Received via mailing list)
rohan dey wrote:
> development:
>   adapter: mysql
>   database: todo
>   username: root
>   password:root
>   host: localhost
You need a space between the colon and the password.  The password line
should literally be "  password: root".
This topic is locked and can not be replied to.