# How to connect ruby on rails to mysql

**URL:** <https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612>\
**Category:** Rails\
**Created:** [February 7, 2013, 10:34am UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612 "2013-02-07T10:34:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkey81185](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@venkey81185](https://www.ruby-forum.com/u/venkey81185)\
**Post date:** [February 7, 2013, 10:34am UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612/1 "2013-02-07T10:34:44Z")

</div>

Hi Friends,

i am new to ruby on rails, i want to connect mysql from ruby on rails,  
how i connect and how to operations like create and update delete . any  
one have idea please help me out

Thanks In Advance  
V.Venkateswara rao

---

<div class="post-metadata">

**Author:** ![venkey81185](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@venkey81185](https://www.ruby-forum.com/u/venkey81185)\
**Post date:** [February 7, 2013, 10:37am UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612/2 "2013-02-07T10:37:46Z")

</div>

Go read a tutorial.

> **[Ruby on Rails Tutorial](https://www.railstutorial.org/book)**
>
> Newly updated for Rails 7, the Ruby on Rails Tutorial book and screencast series teach you how to develop and deploy real, industrial-strength web applications with Ruby on Rails, the open-source web framework that powers top websites such as GitHub,...

–  
Dheeraj K.

---

<div class="post-metadata">

**Author:** ![venkey81185](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@venkey81185](https://www.ruby-forum.com/u/venkey81185)\
**Post date:** [February 7, 2013, 10:46am UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612/3 "2013-02-07T10:46:32Z")

</div>

On 7 February 2013 09:36, Dheeraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Go read a tutorial.
> 
> [Chapter 1: From zero to deploy | Ruby on Rails Tutorial | Learn Enough to Be Dangerous](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book)

Agreed, but do more than read it, work right through the tutorial in  
order to understand the basics of rails. The tutorial is free to use  
online.

Colin

---

<div class="post-metadata">

**Author:** ![venkey81185](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@venkey81185](https://www.ruby-forum.com/u/venkey81185)\
**Post date:** [February 7, 2013, 12:07pm UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612/4 "2013-02-07T12:07:08Z")

</div>

Colin L. wrote in post #1095694:

> On 7 February 2013 09:36, Dheeraj K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Go read a tutorial.
> > 
> > [Chapter 1: From zero to deploy | Ruby on Rails Tutorial | Learn Enough to Be Dangerous](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book)
> 
> Agreed, but do more than read it, work right through the tutorial in  
> order to understand the basics of rails. The tutorial is free to use  
> online.
> 
> Colin

Thank you Colin…

---

<div class="post-metadata">

**Author:** ![venkey81185](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@venkey81185](https://www.ruby-forum.com/u/venkey81185)\
**Post date:** [February 7, 2013, 1:47pm UTC](https://www.ruby-forum.com/t/how-to-connect-ruby-on-rails-to-mysql/229612/5 "2013-02-07T13:47:44Z")

</div>

For connecting mysql to your rails App follow below commands

1. in terminal when your creating new App  
rails new -d mysql (-d for database)
2. Open your database.yml file (Appname/config/database.yml)  
give password of your mysql at DEVELOPMENT and Testing
3. rake db:create  
4.rake db:migrate

On Thu, Feb 7, 2013 at 4:37 PM, Venkat V.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> > 
> 
> –  
> You received this message because you are subscribed to the Google G.  
> “Ruby on Rails: Talk” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid).  
> To post to this group, send email to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

–
