# Mysql::Error in RecipeController#new

**URL:** <https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538>\
**Category:** Rails\
**Created:** [May 15, 2006, 11:57am UTC](https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538 "2006-05-15T11:57:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://www.ruby-forum.com/u/alexandre)\
**Post date:** [May 15, 2006, 11:57am UTC](https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538/1 "2006-05-15T11:57:57Z")

</div>

Hi,

I’m doing the following tutorial  
:[Radar – O’Reilly](http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=3)  
but when I’m trying to access the database I get the following error

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

That’s strange because the database.yml file is defined with a password  
:

development:  
adapter: mysql  
database: cookbook  
username: root  
password: xxxx  
host: localhost

test:  
adapter: mysql  
database: cookbook  
username: root  
password: xxxx  
host: localhost

production:  
adapter: mysql  
database: cookbook  
username: root  
password: xxxx  
host: localhost

Any idea ? Thanks

---

<div class="post-metadata">

**Author:** ![alexandre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://www.ruby-forum.com/u/alexandre)\
**Post date:** [May 15, 2006, 12:03pm UTC](https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538/2 "2006-05-15T12:03:50Z")

</div>

Hi,

On 15 May 2006, at 10:57, Alexandre AJ wrote:

> #28000Access denied for user ‘root’@‘localhost’ (using password: NO)
> 
> That’s strange because the database.yml file is defined with a  
> password

Did you restart after changing your database.yml?

Jon

---

<div class="post-metadata">

**Author:** ![alexandre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://www.ruby-forum.com/u/alexandre)\
**Post date:** [May 15, 2006, 12:16pm UTC](https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538/3 "2006-05-15T12:16:23Z")

</div>

Don’t use the same database name for test and development/production!  
You will loose all your data as soon as you run a test.  
Can’t help you with your question, sorry.

```
Erik.

```

Alexandre AJ schreef:

> username: root  
> Any idea ? Thanks

–  
Erik van Oosten

> **[Day to day stuff](http://day-to-day-stuff.blogspot.com/)**
>
> Experiences from a hard core JVM programmer. Likes to keep things simple.

---

<div class="post-metadata">

**Author:** ![alexandre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@alexandre](https://www.ruby-forum.com/u/alexandre)\
**Post date:** [May 15, 2006, 1:07pm UTC](https://www.ruby-forum.com/t/mysql-error-in-recipecontroller-new/60538/4 "2006-05-15T13:07:02Z")

</div>

Erik van Oosten wrote:

> Don’t use the same database name for test and development/production!  
> You will loose all your data as soon as you run a test.  
> Can’t help you with your question, sorry.
> 
> ```
> Erik.
> 
> ```
> 
> Alexandre AJ schreef:
> 
> > username: root  
> > Any idea ? Thanks
> 
> –  
> Erik van Oosten  
> [http://www.day-to-day-stuff.blogspot.com/](http://www.day-to-day-stuff.blogspot.com/)

I missed to restart now it’s working fine thanks
