Mysql error


#1

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


#2

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.


#3

Alex Y. 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


#4

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".