PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Problem with ruby + mysql on windows
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Problem with ruby + mysql on windows

Réponse
 
LinkBack Outils de la discussion
Vieux 23/05/2008, 17h51   #1
Bruno Moura
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Problem with ruby + mysql on windows

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 me, please?

Thank's

Berable
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 23/05/2008, 21h36   #2
Roger Pack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows


> 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 ?
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 26/05/2008, 14h15   #3
Bruno Moura
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows

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:
>
>> 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 ?


--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 26/05/2008, 14h19   #4
Roger Pack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows

maybe try a different version of the mysql dll?

>>> Error in the entry of procedure mysql_stmt_row_tell in lib LIBMYSQL.dll?


--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 26/05/2008, 14h23   #5
Bruno Moura
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows

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!

--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 26/05/2008, 14h38   #6
Roger Pack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows

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
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 26/05/2008, 15h00   #7
Bruno Moura
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Problem with ruby + mysql on windows

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:
> 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


--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h50.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13091 seconds with 15 queries