# Mysql & Ruby in windows, it's possible ?!

**URL:** <https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637>\
**Category:** Ruby\
**Created:** [June 5, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637 "2008-06-05T17:49:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 5, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/1 "2008-06-05T17:49:28Z")

</div>

#Program:

require ‘mysql’

m = Mysql.new(“localhost”,“root”,“your\_password”,“library”)  
r = m.query(“SELECT \* FROM autor ORDER BY nome”)  
r.each\_hash do |f|  
print “#{f[‘nome’]} - #{f[‘sobrenome’]}”  
end

#error

## C:/InstantRails-1.6/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so: 998: Invalid access to local memory.

C:/InstantRails-1.6/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so  
(LoadError)  
from  
C:/InstantRails-1.6/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in  
`require’  
from mssqltest.rb:1

Output completed (1 sec consumed) - Normal Termination

I’ve had installed both mysql gems (windown e Ruby version 2.7)

Could you help-me? Please and thanks!

---

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 6, 2008, 1:08am UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/2 "2008-06-06T01:08:43Z")

</div>

> Could you help-me? Please and thanks!  
> try the OCI + mysql gem + latest mysql binary. [?]

---

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 6, 2008, 5:56am UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/3 "2008-06-06T05:56:33Z")

</div>

Roger P. wrote:

> > Could you help-me? Please and thanks!  
> > try the OCI + mysql gem + latest mysql binary. [?]

What’s OCI?

I have mysql gem installed and mysql binary is new.

---

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 6, 2008, 6:24am UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/4 "2008-06-06T06:24:20Z")

</div>

Bruno M. wrote:

> Roger P. wrote:
> 
> > > Could you help-me? Please and thanks!  
> > > try the OCI + mysql gem + latest mysql binary. [?]
> 
> What’s OCI?
> 
> I have mysql gem installed and mysql binary is new.

one click installer

---

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 6, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/5 "2008-06-06T17:04:31Z")

</div>

On Jun 6, 5:55 am, Bruno M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Roger P. wrote:
> 
> > > Could you help-me? Please and thanks!  
> > > try the OCI + mysql gem + latest mysql binary. [?]
> 
> What’s OCI?
> 
> I have mysql gem installed and mysql binary is new.

What version of MySQL? what error are you getting? can you provide  
code to reproduce it?

You don’t give us enough tools to actually help you, no matter how  
hard we try, I never got my diploma on telepathy.

FYi, if you’re using MySQL 5.1 windows Mysql gem will not work, there  
are some changes in the underlying mysql library that break  
compatibility between 5.0 and 5.1.

HTH,

---

<div class="post-metadata">

**Author:** ![m4lloc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/87869e/32.png) [@m4lloc](https://www.ruby-forum.com/u/m4lloc)\
**Post date:** [June 6, 2008, 5:42pm UTC](https://www.ruby-forum.com/t/mysql-ruby-in-windows-its-possible/139637/6 "2008-06-06T17:42:18Z")

</div>

Luis L. wrote:

> On Jun 6, 5:55ï¿½am, Bruno M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Roger P. wrote:
> > 
> > > > Could you help-me? Please and thanks!  
> > > > try the OCI + mysql gem + latest mysql binary. ï¿½[?]
> > 
> > What’s OCI?
> > 
> > I have mysql gem installed and mysql binary is new.
> 
> What version of MySQL? what error are you getting? can you provide  
> code to reproduce it?
> 
> You don’t give us enough tools to actually help you, no matter how  
> hard we try, I never got my diploma on telepathy.
> 
> FYi, if you’re using MySQL 5.1 windows Mysql gem will not work, there  
> are some changes in the underlying mysql library that break  
> compatibility between 5.0 and 5.1.
> 
> HTH,

The version is 5.0.27 , but with rails works fine…

ItÂ´s possible
