# Mysql ruby settup

**URL:** <https://www.ruby-forum.com/t/mysql-ruby-settup/66705>\
**Category:** Ruby\
**Created:** [August 28, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705 "2006-08-28T15:36:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/1 "2006-08-28T15:36:42Z")

</div>

To use mysql with a ruby application  
is these modules at [http://dev.mysql.com/downloads/ruby.html](http://dev.mysql.com/downloads/ruby.html) all I need?

Also is there any good tutorials talking about using mysql with ruby?  
Or setting up your first ruby mysql application.

Thank you for your time

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/2 "2006-08-28T16:20:59Z")

</div>

Ok I thought for a bit I might need both modules, but I  
think now I only need one.

I could do with someone who has already gone through these steps to give  
a bit of advice though.

Which is better? Or which should you use for what?

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 4:51pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/3 "2006-08-28T16:51:05Z")

</div>

Mer G. wrote:

> Ok I thought for a bit I might need both modules, but I  
> think now I only need one.

You only need one.

> Which is better? Or which should you use for what?

Use the C binding I’d say. It’ll be both faster, and the logic is  
performed by the “original” MySQL interface library, and because of that  
will probably be both more stable and complete.

Use the pure Ruby binding if you have to deploy on a platform where you  
can’t compile the extension, or where a binary gem isn’t available.  
(Which leaves only rare edge cases - shell accounts on shared \*nix boxes  
without GCC, or 64-bit Windowsen.)

David V.

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/4 "2006-08-28T17:05:09Z")

</div>

Mer G. wrote:

> David V. wrote:  
> It shouldnt add an extra level of complexity when I try to make an .exe  
> file for an application will it?

I’m afraid I have precious little idea how rubyscript2exe works. I’m  
quite sure it can handle native bindings somehow though - the package  
would be nigh on useless if it couldn’t, and I think the topic cropped  
up on the list already. Search the archives for “rubyscript2exe” and  
“dll” or “native” perhaps?

David V.

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 4:57pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/5 "2006-08-28T16:57:11Z")

</div>

David V. wrote:

> Use the C binding I’d say. It’ll be both faster, and the logic is  
> performed by the “original” MySQL interface library, and because of that  
> will probably be both more stable and complete.
> 
> Use the pure Ruby binding if you have to deploy on a platform where you  
> can’t compile the extension, or where a binary gem isn’t available.  
> (Which leaves only rare edge cases - shell accounts on shared \*nix boxes  
> without GCC, or 64-bit Windowsen.)
> 
> David V.

Thanks. The C binding will work better then.

It shouldnt add an extra level of complexity when I try to make an .exe  
file for an application will it?

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 5:10pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/6 "2006-08-28T17:10:29Z")

</div>

David V. wrote:

> I’m afraid I have precious little idea how rubyscript2exe works. I’m  
> quite sure it can handle native bindings somehow though - the package  
> would be nigh on useless if it couldn’t, and I think the topic cropped  
> up on the list already. Search the archives for “rubyscript2exe” and  
> “dll” or “native” perhaps?
> 
> David V.

thanks. will do.

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [August 28, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/7 "2006-08-28T18:25:25Z")

</div>

On 8/28/06, David V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> can’t compile the extension, or where a binary gem isn’t available.  
> (Which leaves only rare edge cases - shell accounts on shared \*nix boxes  
> without GCC, or 64-bit Windowsen.)

This seems a bit unusual to me that the two projects have such similar  
names: “MySQL/Ruby” vs. “Ruby/MySQL”.

What seems to add to the confusion, is that the relevant kitebird  
article [http://www.kitebird.com/articles/ruby-mysql.html](http://www.kitebird.com/articles/ruby-mysql.html) has “Ruby  
MySQL” in the title, and “ruby-mysql” in the url, but seems to be  
written about MySQL/Ruby.

BTW, how does Ruby/MySQL talk to the DBMS? Over port 3306, just like  
the mysql client?

Also, that [dev.mysql.com](http://dev.mysql.com) page says that Ruby/MySQL is included with  
Rails. This means ActiveRecord uses it, right?

Finally, can Ruby-DBI ([http://ruby-dbi.rubyforge.org/](http://ruby-dbi.rubyforge.org/)) use either  
MySQL/Ruby or Ruby/MySQL?

Thanks,  
—John

---

<div class="post-metadata">

**Author:** ![merrua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@merrua](https://www.ruby-forum.com/u/merrua)\
**Post date:** [September 4, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/mysql-ruby-settup/66705/8 "2006-09-04T17:31:56Z")

</div>

John G. wrote:

> Also, that [dev.mysql.com](http://dev.mysql.com) page says that Ruby/MySQL is included with  
> Rails. This means ActiveRecord uses it, right?
> 
> Finally, can Ruby-DBI ([http://ruby-dbi.rubyforge.org/](http://ruby-dbi.rubyforge.org/)) use either  
> MySQL/Ruby or Ruby/MySQL?
> 
> Thanks,  
> —John

Not sure about the rest but the answer to these two is yes I think  
from what i read.
