# Connecting to other databases not development, production, t

**URL:** <https://www.ruby-forum.com/t/connecting-to-other-databases-not-development-production-t/106328>\
**Category:** Rails\
**Created:** [June 8, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/connecting-to-other-databases-not-development-production-t/106328 "2007-06-08T16:34:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![psimoes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6a8cbe/32.png) [@psimoes](https://www.ruby-forum.com/u/psimoes)\
**Post date:** [June 8, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/connecting-to-other-databases-not-development-production-t/106328/1 "2007-06-08T16:34:37Z")

</div>

Hello,

I’ve set my database.yml like this:

development:  
adapter: mysql  
database: teste\_development  
username: root  
password:  
socket: /var/run/mysqld/mysqld.sock

test:  
adapter: mysql  
database: teste\_test  
username: root  
password:  
socket: /var/run/mysqld/mysqld.sock

production:  
adapter: mysql  
database: teste\_production  
username: root  
password:  
socket: /var/run/mysqld/mysqld.sock

other\_db:  
adapter: mysql  
database: somedatabase  
username: user  
password: pass  
socket: /var/run/mysqld/mysqld.sock  
host: localhost

In the model I set the connection with: establish\_connection  
“other\_db”

When I run the controller in the browser I get the following error:  
other\_db database is not configured

Did I miss something? (I restarted the web server)

Thanks.

---

<div class="post-metadata">

**Author:** ![psimoes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6a8cbe/32.png) [@psimoes](https://www.ruby-forum.com/u/psimoes)\
**Post date:** [June 8, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/connecting-to-other-databases-not-development-production-t/106328/2 "2007-06-08T17:36:43Z")

</div>

> Hello,
> 
> I’ve set my database.yml like this:  
> …  
> username: user
> 
> Did I miss something? (I restarted the web server)

Maybe a copy/paste error, but that last entry looks like you are using  
tabs, not spaces… and YAML files hate tabs…

?

-philip

---

<div class="post-metadata">

**Author:** ![psimoes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6a8cbe/32.png) [@psimoes](https://www.ruby-forum.com/u/psimoes)\
**Post date:** [June 8, 2007, 6:29pm UTC](https://www.ruby-forum.com/t/connecting-to-other-databases-not-development-production-t/106328/3 "2007-06-08T18:29:49Z")

</div>

Exactly, I thought the YAML files were smarter 🙂
