# Problem with ruby + mysql on windows

**URL:** <https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499>\
**Category:** Ruby\
**Created:** [May 23, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499 "2008-05-23T18:51:59Z")\
**Posts on this page:** 7\
**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:** [May 23, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/1 "2008-05-23T18:51:59Z")

</div>

Hello

I’m having a problem to conect and use ruby to performe some operations  
with a mysql database. I downloaded the gem mysql 2.7.3 (win32) and  
added the windows path with mysql bin and mysql lib entries.When a try  
to execute the script below an error occurs, with a message:

Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?

in the code:

require ‘rubygems’  
require ‘mysql’

m = Mysql.new(“localhost”,“user”,“pass”,“database”)  
r = m.query(“SELECT \* FROM table”)  
r.each\_hash do |f|  
print “#{f[‘camp1’]} - #{f[‘camp2’]}”  
end

Could you help me, please?

Thank’s

Berable

---

<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:** [May 23, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/2 "2008-05-23T22:35:50Z")

</div>

> Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?  
> googling for that error message yielded  
> [mysql\_stmt\_row\_tell and libmysql.dll error for Instant Rails | Forward](http://brianbruijn.wordpress.com/2008/05/12/mysql_stmt_row_tell-and-libmysqldll-error-for-instant-rails/)  
> does that help?

---

<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:** [May 26, 2008, 3:16pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/3 "2008-05-26T15:16:30Z")

</div>

another error happened:

> ruby mysql2.rb  
> C:/InstantRails-1.6/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so:  
> 998: Acesso invÃ¡lido ao local de memÃ³ria. (Invalid Access of memory  
> location) -  
> 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 mysql2.rb:2  
> Exit code: 1

The code are the same.

Thank’s for your interest Roger!

Roger P. wrote:

> > Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?  
> > googling for that error message yielded  
> > [mysql\_stmt\_row\_tell and libmysql.dll error for Instant Rails | Forward](http://brianbruijn.wordpress.com/2008/05/12/mysql_stmt_row_tell-and-libmysqldll-error-for-instant-rails/)  
> > does that help?

---

<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:** [May 26, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/4 "2008-05-26T15:20:25Z")

</div>

maybe try a different version of the mysql dll?

> > > Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?

---

<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:** [May 26, 2008, 3:24pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/5 "2008-05-26T15:24:14Z")

</div>

Humm,complicated…

how can I know the right version of library I shoud use?

Roger P. wrote:

> maybe try a different version of the mysql dll?
> 
> > > > Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?

Thank’s again!

---

<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:** [May 26, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/6 "2008-05-26T16:00:55Z")

</div>

My code runs in your machine… puts!

mysql Ver 14.12 Distrib 5.0.27, for Win32 (ia32)

humm my number version is bit different…

I’ll try to install another version of instant rails or install the  
complet  
stack at begining (ruby, mysql, rails, not istant rails).

Thank’s so much Roger!

Roger P. wrote:

> Bruno M. wrote:
> 
> > Humm,complicated…
> > 
> > how can I know the right version of library I shoud use?
> > 
> > Roger P. wrote:
> > 
> > > maybe try a different version of the mysql dll?
> > > 
> > > > > > Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?
> > 
> > Thank’s again!
> 
> For me with your gem, I have  
> “c:\program files\mysql…\bin” in my path, and  
> version 14.12 Distrib 5.0.45 [from running mysql --version]  
> installed and the code that you posted works. That’s with XP so maybe  
> that’s a factor.  
> -R

---

<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:** [May 26, 2008, 3:39pm UTC](https://www.ruby-forum.com/t/problem-with-ruby-mysql-on-windows/138499/7 "2008-05-26T15:39:33Z")

</div>

Bruno M. wrote:

> Humm,complicated…
> 
> how can I know the right version of library I shoud use?
> 
> Roger P. wrote:
> 
> > maybe try a different version of the mysql dll?
> > 
> > > > > Error in the entry of procedure mysql\_stmt\_row\_tell in lib LIBMYSQL.dll?
> 
> Thank’s again!

For me with your gem, I have  
“c:\program files\mysql…\bin” in my path, and  
version 14.12 Distrib 5.0.45 [from running mysql --version]  
installed and the code that you posted works. That’s with XP so maybe  
that’s a factor.  
-R
