keyongtech


  keyongtech > ruby

 #1  
05-23-08, 05:51 PM
Bruno Moura
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
 #2  
05-23-08, 09:36 PM
Roger Pack
> Error in the entry of procedure mysql_stmt_row_tell in lib LIBMYSQL.dll?
googling for that error message yielded
http://brianbruijn.wordpress.com/200...instant-rails/
does that help?
 #3  
05-26-08, 02:15 PM
Bruno Moura
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 Pack wrote:
[..]
 #4  
05-26-08, 02:19 PM
Roger Pack
maybe try a different version of the mysql dll?
 #5  
05-26-08, 02:23 PM
Bruno Moura
Humm,complicated...

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

Roger Pack 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!
 #6  
05-26-08, 02:38 PM
Roger Pack
Bruno Moura wrote:
> Humm,complicated...
>
> how can I know the right version of library I shoud use?
>
> Roger Pack 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
 #7  
05-26-08, 03:00 PM
Bruno Moura
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 Pack wrote:
[..]
Similar Threads
Thread Thread Starter
Ruby-mysql API on Windows

Where do I find the latest version of Ruby-mysql API on Windows which will interface with MYSQL 5.1. I do not have a MS C complier, thus I am looking for the...

jhs408
Ruby, MySQL, and Windows

I wrote everything up... [..] If you see any obvious errors in my thinking, please leave a comment.

Justin Rudd
mysql-ruby-2.4.5 problem

--=-spKdg9uAI3Y4+jYWcE6X Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi I am trying to install the MySql module but receive the following error: ruby...

William Sundberg
mysql-ruby for ruby 1.8.1 on windows ...

Does anyone ever compiled them sucessfully? Please post the binary ... thanks

Useko Netsumi
Problem in Ruby with Mysql

This is a multipart mime message --Next_1067946139---0-203.199.83.39-10392 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding:...

Sabyasachi Mustafi

Privacy Policy | All times are GMT. The time now is 02:44 PM.

Merging Information Logo
[Deutschland] [España] [France] [Italia] [Nederland] [Polska] [United Kingdom]