# Ruby and mysql

**URL:** <https://www.ruby-forum.com/t/ruby-and-mysql/69736>\
**Category:** Ruby\
**Created:** [September 23, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/69736 "2006-09-23T16:27:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 23, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/69736/1 "2006-09-23T16:27:19Z")

</div>

hello!

can someone explain to me the basic usage for the native mysql  
bindings for ruby?

I’m on OSX and have installed the pure ruby drivers (mysql-2.7) using  
gem

however, i’m getting the following error on trying a simple connection.

Mysql::Error: Client does not support authentication protocol  
requested by server; consider upgrading MySQL client

so, it looks like the pure ruby drivers are pretty old. maybe the  
native ones are newer?

is there any difference in usage?

also, i guess there are generic DBI drivers - is this a more recommended  
route?  
[http://ruby-dbi.rubyforge.org/](http://ruby-dbi.rubyforge.org/)

since i also want to do some rails stuff, does rails assume mysql is  
working, and/or need the naive libs for that working?

~/src/ruby-mysql-0.2.6 \> sudo ruby ./test.rb localhost XXX XXXPW  
connect…/mysql.rb:453:in `read': Client does not support authentication protocol requested by server; consider upgrading MySQL client (Mysql::Error) from ./mysql.rb:130:in `real\_connect’  
from ./mysql.rb:91:in `initialize' from ./mysql.rb:1085:in `new’  
from ./mysql.rb:1085:in `connect' from ./t/00connect.rb:1 from ./test.rb:23:in `load’  
from ./test.rb:23  
from ./test.rb:19:in `each’  
from ./test.rb:19

thanks for any help!

## /dc

```
  David "DC" Collier

```

[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
+81 (0)80 6521 9559  
skype: callto://d3ntaku

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 23, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/69736/2 "2006-09-23T18:55:32Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

dc wrote:

> also, i guess there are generic DBI drivers - is this a more recommended  
> route?  
> [http://ruby-dbi.rubyforge.org/](http://ruby-dbi.rubyforge.org/)

DBI is just a database abstraction library, it still depends on the  
vendor-specific clients.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.5 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iD8DBQFFFT5gy6MhrS8astoRArfkAJ0Qu6r701PjDwokSNykIgQ8apTGlQCeOIFV  
kz2YM1eUFGtMV/VzsTBn30Q=  
=vHrO  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 23, 2006, 9:59pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/69736/3 "2006-09-23T21:59:50Z")

</div>

dc wrote:

> requested by server; consider upgrading MySQL client
> 
> so, it looks like the pure ruby drivers are pretty old. maybe the  
> native ones are newer?

You can probably change security settings on the database as well.

```
robert
```

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 23, 2006, 11:38pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/69736/4 "2006-09-23T23:38:06Z")

</div>

OK got things to work. after lots of google hiccups, this article  
solved things regarding recompiling latest ruby/mysql drivers.

i think the main issue is that if you have the gem libs installed,  
they somehow get used first, instead of the native drivers?

[http://tonyarnold.com/articles/2005/08/11/mysql-bindings-for-ruby-under-mac-os-x-tiger](http://tonyarnold.com/articles/2005/08/11/mysql-bindings-for-ruby-under-mac-os-x-tiger)

for what its worth, cocoaMysql beta version is also needed to connect…

this was unfortunately a lot more painful than setting up on windows…

/dc

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

> vendor-specific clients.  
> -----BEGIN PGP SIGNATURE-----  
> Version: GnuPG v1.4.5 (MingW32)  
> Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)
> 
> iD8DBQFFFT5gy6MhrS8astoRArfkAJ0Qu6r701PjDwokSNykIgQ8apTGlQCeOIFV  
> kz2YM1eUFGtMV/VzsTBn30Q=  
> =vHrO  
> -----END PGP SIGNATURE-----

## –

```
  David "DC" Collier

```

[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
+81 (0)80 6521 9559  
skype: callto://d3ntaku
