# Connecting Ruby on rails with MySQL

**URL:** <https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643>\
**Category:** Rails\
**Created:** [June 20, 2009, 2:00am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643 "2009-06-20T02:00:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 20, 2009, 2:00am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/1 "2009-06-20T02:00:53Z")

</div>

I am using Fedora 8 in my system and I have installed ruby, rails and  
mysql…Can anyone please explain the steps for connecting Ruby on Rails  
with MySQL.

Actually I am getting this problem  
$rake db.migrate  
(in /home/niket/depot)  
rake aborted!  
Don’t know how to build task ‘db.migrate’

(See full trace by running task with --trace)

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 20, 2009, 2:07am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/2 "2009-06-20T02:07:40Z")

</div>

Make sure you use a color, not a period → rake db:migrate

Have you setup your database.yml file to point to a Mysql server?

On Jun 19, 5:00 pm, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 20, 2009, 2:13am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/3 "2009-06-20T02:13:55Z")

</div>

E. Litwin wrote:

> Make sure you use a color, not a period → rake db:migrate
> 
> Have you setup your database.yml file to point to a Mysql server?
> 
> On Jun 19, 5:00ï¿½pm, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

May I Know how we setup database.yml. Sir I have used this command to  
configure database.yml as in this way… $ vim  
/configure/database.yml…but i am unable to access the contents of  
database.yml file.  
Can u please ezplain the steps how to read the contents of database.yml.  
and after that create a database

Dont mind Sir I am new to Linux and its getting me a bit tough to access  
the command prompt

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 20, 2009, 2:25am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/4 "2009-06-20T02:25:12Z")

</div>

Assuming you are in the root of your project in a terminal session

$ nano config/database.yml

Modify this section as necessary  
development:  
adapter: mysql  
database: [enter an existing db name]  
username: [login]  
password: [password]  
host: [server or localhost]

Ctrl+o → Enter to save changes  
Ctrl+x → Quit

On Jun 19, 5:13 pm, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 20, 2009, 3:28pm UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/5 "2009-06-20T15:28:36Z")

</div>

try rake db:migrate (the colon is important)

On Jun 20, 2:00 am, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 23, 2009, 12:03am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/6 "2009-06-23T00:03:47Z")

</div>

Christoph wrote:

> try rake db:migrate (the colon is important)
> 
> On Jun 20, 2:00ï¿½am, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

I am unable to get access to that file database.yml even though I tried  
as  
$ nano configure/database.yml…just a blank editor is opening.  
How to know the path where is this file stored

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 23, 2009, 12:10am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/7 "2009-06-23T00:10:34Z")

</div>

On Jun 22, 11:03 pm, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Christoph wrote:
> 
> > try rake db:migrate (the colon is important)
> 
> > On Jun 20, 2:00 am, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> I am unable to get access to that file database.yml even though I tried  
> as  
> $ nano configure/database.yml…just a blank editor is opening.  
> How to know the path where is this file stored

just poke around the filesystem as you would normally (the file is in  
a folder called config, not configure (and you would of course need to  
have switched to your application’s directory first))

Fred

---

<div class="post-metadata">

**Author:** ![scholar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@scholar](https://www.ruby-forum.com/u/scholar)\
**Post date:** [June 23, 2009, 12:30am UTC](https://www.ruby-forum.com/t/connecting-ruby-on-rails-with-mysql/170643/8 "2009-06-23T00:30:47Z")

</div>

Frederick C. wrote:

> On Jun 22, 11:03ï¿½pm, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Christoph wrote:
> > 
> > > try rake db:migrate (the colon is important)
> > 
> > > On Jun 20, 2:00 am, Niketh K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> > 
> > I am unable to get access to that file database.yml even though I tried  
> > as  
> > $ nano configure/database.yml…just a blank editor is opening.  
> > How to know the path where is this file stored
> 
> just poke around the filesystem as you would normally (the file is in  
> a folder called config, not configure (and you would of course need to  
> have switched to your application’s directory first))
> 
> Fred

Thank U for ur reply Fred…  
Can u clear my doubts by chatting with me on gmail.  
I am new to command prompt and unable to locate the config file.  
Or either please add my email id: removed\_email\_address@domain.invalid
