# How to use mysql in rails

**URL:** <https://www.ruby-forum.com/t/how-to-use-mysql-in-rails/106266>\
**Category:** Rails\
**Created:** [June 7, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/how-to-use-mysql-in-rails/106266 "2007-06-07T22:39:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 7, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/how-to-use-mysql-in-rails/106266/1 "2007-06-07T22:39:37Z")

</div>

I am looking for some documentation on how to use mysql in rails. Only  
command I know is ‘model.find’ this will find the row by primary key.  
I would like to read about all the other commands available to me to  
use.  
I want to search the model for last name is like a parameter, how can  
I do that?

I would really appriciate if someone can point me to a link or  
documentation on it? I did a seach on Google and I didn’t find  
anything really useful for what I want to do (or may be I didn’t  
understand).

Thanks.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 7, 2007, 10:48pm UTC](https://www.ruby-forum.com/t/how-to-use-mysql-in-rails/106266/2 "2007-06-07T22:48:38Z")

</div>

On 6/7/07, DBC User [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> anything really useful for what I want to do (or may be I didn’t  
> understand).
> 
> Thanks.
> 
> >

For Use SQL :

[http://api.rubyonrails.com/classes/ActiveRecord/Base.html](http://api.rubyonrails.com/classes/ActiveRecord/Base.html)

for association with SQL :

[http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html](http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html)

All is write into. It very complete

–  
Cyril M.

---

<div class="post-metadata">

**Author:** ![DBC\_User](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@DBC\_User](https://www.ruby-forum.com/u/DBC_User)\
**Post date:** [June 7, 2007, 10:48pm UTC](https://www.ruby-forum.com/t/how-to-use-mysql-in-rails/106266/3 "2007-06-07T22:48:38Z")

</div>

DBC User wrote:

> understand).  
> What you’re asking for is really basic stuff. Get a copy of Agile  
> Webdevelopment With Rails and all will become clear. In the meantime  
> check out the API docs. The question to your answer is listed under the  
> find method on this page:

> **[ActiveRecord::Base](https://api.rubyonrails.org/classes/ActiveRecord/Base.html)**
>
> Active Record Active Record objects don't specify their attributes directly, but rather infer them from the table definition with which they're linked.

–  
Cheers,

- Jacob A.
