# MySQL with windows

**URL:** <https://www.ruby-forum.com/t/mysql-with-windows/59184>\
**Category:** Ruby\
**Created:** [April 30, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/mysql-with-windows/59184 "2006-04-30T21:19:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdruse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b38774/32.png) [@jdruse](https://www.ruby-forum.com/u/jdruse)\
**Post date:** [April 30, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/mysql-with-windows/59184/1 "2006-04-30T21:19:52Z")

</div>

I am new to both ruby and am trying to install the API for mysql using  
the link [http://raa.ruby-lang.org/project/mysql-ruby/](http://raa.ruby-lang.org/project/mysql-ruby/). I am using  
version 1.8.4 for ruby and 5.0.19-nt for mysql. Following the  
readme-winpkg I entered ruby install.rb -n and got  
install  
mingw32/mysql.so =\> c:/ruby/lib/ruby/site\_ruby/1.8/i386-msvcrt  
I then ran the simple.rb

# simple.rb - simple MySQL script using Ruby MySQL module

require “mysql”

begin

# connect to the MySQL server

dbh = Mysql.real\_connect(“localhost”, “testuser”, “testpass”, “test”)

# get server version string and display it

puts "Server version: " + dbh.get\_server\_info  
rescue MysqlError =\> e  
print "Error code: ", e.errno, “\n”  
print "Error message: ", e.error, “\n”  
ensure

# disconnect from server

dbh.close  
end  
from [http://www.kitebird.com/articles/ruby-mysql.html](http://www.kitebird.com/articles/ruby-mysql.html) and got:  
Error code:1251  
Error message: Client does not support authentication protocol requested  
by server; consider upgrading mysql client  
simple.rb:13: undefined method ‘close’ for nil:NilClass

Are there any suggestion on how I can get the ruby API for mysql  
installed and running?

---

<div class="post-metadata">

**Author:** ![jdruse](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b38774/32.png) [@jdruse](https://www.ruby-forum.com/u/jdruse)\
**Post date:** [May 3, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/mysql-with-windows/59184/2 "2006-05-03T18:57:01Z")

</div>

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

Jon D. wrote:

> dbh.close  
> end  
> from [http://www.kitebird.com/articles/ruby-mysql.html](http://www.kitebird.com/articles/ruby-mysql.html) and got:  
> Error code:1251  
> Error message: Client does not support authentication protocol requested  
> by server; consider upgrading mysql client  
> simple.rb:13: undefined method ‘close’ for nil:NilClass
> 
> Are there any suggestion on how I can get the ruby API for mysql  
> installed and running?

Run irb, and see what version your client is…

require ‘mysql’  
Mysql.client\_info

Chances are it’s a 4.0.x client and it doesn’t support normal password  
hash mechanism used by mysql 4.1.x and 5.0.x. You can  
google around and look for a windows mysql.so binary for mysql 5

Zach  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.1 (GNU/Linux)  
Comment: Using GnuPG with Thunderbird - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iD8DBQFEVWcYMyx0fW1d8G0RAkucAJ9WM17WO9oBgUS3Dz8/ws/TL627kgCdG9eR  
mNRRLFRCz3BXIZWXsgNzyP8=  
=ItHG  
-----END PGP SIGNATURE-----
