# Connecting database with railo

**URL:** <https://www.ruby-forum.com/t/connecting-database-with-railo/136040>\
**Category:** Rails\
**Created:** [April 28, 2008, 11:16am UTC](https://www.ruby-forum.com/t/connecting-database-with-railo/136040 "2008-04-28T11:16:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [April 28, 2008, 11:16am UTC](https://www.ruby-forum.com/t/connecting-database-with-railo/136040/1 "2008-04-28T11:16:47Z")

</div>

i m not able to connect to database  
I am create my rails folder i get database.yml file in this format

# SQLite version 3.x

# gem install sqlite3-ruby (not necessary on OS X Leopard)

development:  
adapter: sqlite3  
database: db/development.sqlite3  
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  
timeout: 5000

production:  
adapter: sqlite3  
database: db/production.sqlite3  
timeout: 5000  
how can i change in the correct format

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [April 28, 2008, 11:20am UTC](https://www.ruby-forum.com/t/connecting-database-with-railo/136040/2 "2008-04-28T11:20:43Z")

</div>

> i m not able to connect to database

does mean what?  
you have a sqlite up and running and it can’t connect?  
what errors do you get?  
did you create the database? what name did you give it?

what OS do you use? maybe you have to install the sqlite3-ruby?

or do you want to use another database, eg mysql?

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [April 28, 2008, 11:32am UTC](https://www.ruby-forum.com/t/connecting-database-with-railo/136040/3 "2008-04-28T11:32:51Z")

</div>

I have installed ruby-186-26  
I am trying to connect it to mysql .should I use sqlite as database?how  
can i do it? what should i do ?

---

<div class="post-metadata">

**Author:** ![manika](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@manika](https://www.ruby-forum.com/u/manika)\
**Post date:** [April 28, 2008, 12:13pm UTC](https://www.ruby-forum.com/t/connecting-database-with-railo/136040/4 "2008-04-28T12:13:33Z")

</div>

Mania S. wrote:

> I have installed ruby-186-26  
> I am trying to connect it to mysql .should I use sqlite as database?how  
> can i do it? what should i do ?

nope, mysql is fine  
sqlite is just the default option, you could use it if you want but  
that’s not mandatory (we use mysql here all the time)

use a setup in database.yml like this:

development:  
adapter: mysql  
database: myapp\_dev  
username: root  
password:  
test:  
adapter: mysql  
database: myapp\_test  
username: root  
password:  
production:  
adapter: mysql  
database: myapp\_production  
username: root  
password:

where myapp\_\* should match your application name  
(and password must be set if you use one)

after that in your application folder run:  
rake db:create

that will create the databases in mysql  
then you can run

rake db:migrate

to create the tables from your rails migrations if you have defined them  
yet
