[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

MS SQL 2005 Express and MySQL on Windows

Kyle

7/11/2008 2:50:00 AM

The short question: Has anybody successfully connected to both MS SQL
2005 Express and MySQL databases using Ruby on Windows XP? How?

The long description: My company's point-of-sale system uses MS SQL.
A recent upgrade to the software required an upgrade of the database.
I was using ruby on ubuntu with DBI to synchronize the POS (MSSQL
2000) and site (MySQL) databases. When I upgraded the POS database to
2005 Express, using ODBC didn't work anymore - that is, until I got a
driver from EasySoft that will cost 499 pounds if I want to use it for
more than 14 days.

My next thought was, "Oh, I'll put ruby on Windows and use MS's ODBC
driver to connect." That worked fine, but now I'm having troubles
getting to a MySQL database using DBI. I can't seem to load the
module. I get errors about LIBMYSQL.DLL not existing, and if I
install the mysql gem, I get other errors (sorry - I'm not by that
machine now).

I'm using the Windows 1-click installer (186-26). When I try to build
DBI, I get compile errors. I'm also unable to build the mysql-ruby (or
ruby-mysql) package that the DBI resources seem to point to.
Essentially, it looks like I'm having driver errors...or something
like that. I'll try to give more info tomorrow.

Does anybody have suggestions? I'd really appreciate any help, and
I'll be happy to respond with more info.

Thanks!

-Kyle

5 Answers

hemant

7/11/2008 1:19:00 PM

0

On Fri, Jul 11, 2008 at 8:20 AM, Kyle <kyle.rabe@gmail.com> wrote:
> The short question: Has anybody successfully connected to both MS SQL
> 2005 Express and MySQL databases using Ruby on Windows XP? How?
>
> The long description: My company's point-of-sale system uses MS SQL.
> A recent upgrade to the software required an upgrade of the database.
> I was using ruby on ubuntu with DBI to synchronize the POS (MSSQL
> 2000) and site (MySQL) databases. When I upgraded the POS database to
> 2005 Express, using ODBC didn't work anymore - that is, until I got a
> driver from EasySoft that will cost 499 pounds if I want to use it for
> more than 14 days.
>
> My next thought was, "Oh, I'll put ruby on Windows and use MS's ODBC
> driver to connect." That worked fine, but now I'm having troubles
> getting to a MySQL database using DBI. I can't seem to load the
> module. I get errors about LIBMYSQL.DLL not existing, and if I
> install the mysql gem, I get other errors (sorry - I'm not by that
> machine now).
>
> I'm using the Windows 1-click installer (186-26). When I try to build
> DBI, I get compile errors. I'm also unable to build the mysql-ruby (or
> ruby-mysql) package that the DBI resources seem to point to.
> Essentially, it looks like I'm having driver errors...or something
> like that. I'll try to give more info tomorrow.
>
> Does anybody have suggestions? I'd really appreciate any help, and
> I'll be happy to respond with more info.
>

Your mysql problems has nothing to do with your sql server. You don't
have client libraries for mysql i believe.

Download "mysql essentials" from following page your mysql driver
issues should be gone:

http://dev.mysql.com/downloads/mysql/5.0....

Kyle

7/11/2008 3:49:00 PM

0

Thank you for your tips. I'd rather not install Rails if possible -
I'd have to re-write my scripts to use ActiveRecord, and from what I
hear, it's not necessarily easy to get Rails to talk to
MSSQL2005Express anyway...but I'll certainly give it a shot if nothing
else works!

I installed the MySQL Essentials and am getting the following errors:

> require 'mysql'
LoadError: 193: %1 is not a valid Win32 application. =3D C:/Program
Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
from C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/
ext/mysql.so
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_requirement.rb:32:in 'require'

> mysql =3D DBI.connect('dbi:Mysql:.....')
DBI::InterfaceError: Unable to load driver 'Mysql'
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:329:in
'load_driver'
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:227:in
'_get_full_driver'
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:213:in
'connect'

I hate to even think about this, but could this be an issue with Win
XP x64? That's what this machine is running... I also had problems
on a Win32 machine, though, with MySQL already installed. I double-
checked that the MySQL directory was in my PATH, too.

Any other ideas? I hadn't anticipated it being so difficult to get
Ruby to talk to a MySQL database on Windows.

-Kyle

On Jul 11, 8:18=A0am, hemant <gethem...@gmail.com> wrote:
> On Fri, Jul 11, 2008 at 8:20 AM, Kyle <kyle.r...@gmail.com> wrote:
> > The short question: Has anybody successfully connected to both MS SQL
> > 2005 Express and MySQL databases using Ruby on Windows XP? =A0How?
>
> > The long description: My company's point-of-sale system uses MS SQL.
> > A recent upgrade to the software required an upgrade of the database.
> > I was using ruby on ubuntu with DBI to synchronize the POS (MSSQL
> > 2000) and site (MySQL) databases. =A0When I upgraded the POS database t=
o
> > 2005 Express, using ODBC didn't work anymore - that is, until I got a
> > driver from EasySoft that will cost 499 pounds if I want to use it for
> > more than 14 days.
>
> > My next thought was, "Oh, I'll put ruby on Windows and use MS's ODBC
> > driver to connect." =A0That worked fine, but now I'm having troubles
> > getting to a MySQL database using DBI. =A0I can't seem to load the
> > module. =A0I get errors about LIBMYSQL.DLL not existing, and if I
> > install the mysql gem, I get other errors (sorry - I'm not by that
> > machine now).
>
> > I'm using the Windows 1-click installer (186-26). =A0When I try to buil=
d
> > DBI, I get compile errors. I'm also unable to build the mysql-ruby (or
> > ruby-mysql) package that the DBI resources seem to point to.
> > Essentially, it looks like I'm having driver errors...or something
> > like that. =A0I'll try to give more info tomorrow.
>
> > Does anybody have suggestions? =A0I'd really appreciate any help, and
> > I'll be happy to respond with more info.
>
> Your mysql problems has nothing to do with your sql server. You don't
> have client libraries for mysql i believe.
>
> Download "mysql essentials" from following page your mysql driver
> issues should be gone:
>
> http://dev.mysql.com/downloads/mysql/5.0....

Kyle

7/11/2008 3:56:00 PM

0

Update: the 64/32 threw me a bit. I installed the 32-bit MySQL, and
at least now, I'm getting "require 'mysql'" to return "true".

Sorry about that. I'll see how it goes from here and let you know.

-Kyle

On Jul 11, 10:48=A0am, Kyle <kyle.r...@gmail.com> wrote:
> Thank you for your tips. =A0I'd rather not install Rails if possible -
> I'd have to re-write my scripts to use ActiveRecord, and from what I
> hear, it's not necessarily easy to get Rails to talk to
> MSSQL2005Express anyway...but I'll certainly give it a shot if nothing
> else works!
>
> I installed the MySQL Essentials and am getting the following errors:
>
> > require 'mysql'
>
> LoadError: 193: %1 is not a valid Win32 application. =A0 =3D C:/Program
> Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2=
7.3-mswin32/
> ext/mysql.so
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubygem=
s/
> custom_requirement.rb:32:in 'require'
>
> > mysql =3D DBI.connect('dbi:Mysql:.....')
>
> DBI::InterfaceError: Unable to load driver 'Mysql'
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
329:in
> 'load_driver'
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
227:in
> '_get_full_driver'
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
213:in
> 'connect'
>
> I hate to even think about this, but could this be an issue with Win
> XP x64? =A0That's what this machine is running... =A0I also had problems
> on a Win32 machine, though, with MySQL already installed. =A0I double-
> checked that the MySQL directory was in my PATH, too.
>
> Any other ideas? =A0I hadn't anticipated it being so difficult to get
> Ruby to talk to a MySQL database on Windows.
>
> -Kyle
>
> On Jul 11, 8:18=A0am, hemant <gethem...@gmail.com> wrote:
>
> > On Fri, Jul 11, 2008 at 8:20 AM, Kyle <kyle.r...@gmail.com> wrote:
> > > The short question: Has anybody successfully connected to both MS SQL
> > > 2005 Express and MySQL databases using Ruby on Windows XP? =A0How?
>
> > > The long description: My company's point-of-sale system uses MS SQL.
> > > A recent upgrade to the software required an upgrade of the database.
> > > I was using ruby on ubuntu with DBI to synchronize the POS (MSSQL
> > > 2000) and site (MySQL) databases. =A0When I upgraded the POS database=
to
> > > 2005 Express, using ODBC didn't work anymore - that is, until I got a
> > > driver from EasySoft that will cost 499 pounds if I want to use it fo=
r
> > > more than 14 days.
>
> > > My next thought was, "Oh, I'll put ruby on Windows and use MS's ODBC
> > > driver to connect." =A0That worked fine, but now I'm having troubles
> > > getting to a MySQL database using DBI. =A0I can't seem to load the
> > > module. =A0I get errors about LIBMYSQL.DLL not existing, and if I
> > > install the mysql gem, I get other errors (sorry - I'm not by that
> > > machine now).
>
> > > I'm using the Windows 1-click installer (186-26). =A0When I try to bu=
ild
> > > DBI, I get compile errors. I'm also unable to build the mysql-ruby (o=
r
> > > ruby-mysql) package that the DBI resources seem to point to.
> > > Essentially, it looks like I'm having driver errors...or something
> > > like that. =A0I'll try to give more info tomorrow.
>
> > > Does anybody have suggestions? =A0I'd really appreciate any help, and
> > > I'll be happy to respond with more info.
>
> > Your mysql problems has nothing to do with your sql server. You don't
> > have client libraries for mysql i believe.
>
> > Download "mysql essentials" from following page your mysql driver
> > issues should be gone:
>
> >http://dev.mysql.com/downloads/mysql/5.0....
>
>

Kyle

7/11/2008 4:10:00 PM

0

False hope. If I fire up irb, require 'dbi', and then try to load a
mysql connection, I get the same error:

> mysql =3D DBI.connect('dbi:Mysql:.....')
DBI::InterfaceError: Unable to load driver 'Mysql'
=2E..

If I "require 'mysql'", I get "true". If I then try to load a mysql
connection, I get this interesting error:

> require 'mysql'
true

> mysql =3D DBI.connect('dbi:Mysql:.....')
DBI::InterfaceError: Could not load driver (uninitialized constant
Mysql:Driver)
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:344:in
'load_driver'
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:227:in
'_get_full_driver'
from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:213:in
'connect'

Any other thoughts? I'm sorry to bombard the list like this...

-Kyle


On Jul 11, 10:55=A0am, Kyle <kyle.r...@gmail.com> wrote:
> Update: the 64/32 threw me a bit. =A0I installed the 32-bit MySQL, and
> at least now, I'm getting "require 'mysql'" to return "true".
>
> Sorry about that. =A0I'll see how it goes from here and let you know.
>
> -Kyle
>
> On Jul 11, 10:48=A0am, Kyle <kyle.r...@gmail.com> wrote:
>
> > Thank you for your tips. =A0I'd rather not install Rails if possible -
> > I'd have to re-write my scripts to use ActiveRecord, and from what I
> > hear, it's not necessarily easy to get Rails to talk to
> > MSSQL2005Express anyway...but I'll certainly give it a shot if nothing
> > else works!
>
> > I installed the MySQL Essentials and am getting the following errors:
>
> > > require 'mysql'
>
> > LoadError: 193: %1 is not a valid Win32 application. =A0 =3D C:/Program
> > Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
> > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mysql=
-2.7.3-mswin32/
> > ext/mysql.so
> > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rubyg=
ems/
> > custom_requirement.rb:32:in 'require'
>
> > > mysql =3D DBI.connect('dbi:Mysql:.....')
>
> > DBI::InterfaceError: Unable to load driver 'Mysql'
> > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.r=
b:329:in
> > 'load_driver'
> > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.r=
b:227:in
> > '_get_full_driver'
> > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.r=
b:213:in
> > 'connect'
>
> > I hate to even think about this, but could this be an issue with Win
> > XP x64? =A0That's what this machine is running... =A0I also had problem=
s
> > on a Win32 machine, though, with MySQL already installed. =A0I double-
> > checked that the MySQL directory was in my PATH, too.
>
> > Any other ideas? =A0I hadn't anticipated it being so difficult to get
> > Ruby to talk to a MySQL database on Windows.
>
> > -Kyle
>
> > On Jul 11, 8:18=A0am, hemant <gethem...@gmail.com> wrote:
>
> > > On Fri, Jul 11, 2008 at 8:20 AM, Kyle <kyle.r...@gmail.com> wrote:
> > > > The short question: Has anybody successfully connected to both MS S=
QL
> > > > 2005 Express and MySQL databases using Ruby on Windows XP? =A0How?
>
> > > > The long description: My company's point-of-sale system uses MS SQL=

Kyle

7/11/2008 5:21:00 PM

0

OK, I missed something very basic and essential. It's now working. I
needed to copy Mysql.rb from the DBI package to a new C:\Program Files
\Ruby\lib\ruby\site_ruby\1.8\DBD\Mysql folder. I incorrectly assumed
that the DBI package that came with the 1-click installer would
include this DBD. Since I wasn't able to build DBI per the given
instructions, I didn't look into it further. My mistake!

-Kyle

On Jul 11, 11:10=A0am, Kyle <kyle.r...@gmail.com> wrote:
> False hope. =A0If I fire up irb, require 'dbi', and then try to load a
> mysql connection, I get the same error:
>
> > mysql =3D DBI.connect('dbi:Mysql:.....')
>
> DBI::InterfaceError: Unable to load driver 'Mysql'
> ...
>
> If I "require 'mysql'", I get "true". =A0If I then try to load a mysql
> connection, I get this interesting error:
>
> > require 'mysql'
>
> true
>
> > mysql =3D DBI.connect('dbi:Mysql:.....')
>
> DBI::InterfaceError: Could not load driver (uninitialized constant
> Mysql:Driver)
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
344:in
> 'load_driver'
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
227:in
> '_get_full_driver'
> =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi.rb:=
213:in
> 'connect'
>
> Any other thoughts? =A0I'm sorry to bombard the list like this...
>
> -Kyle
>
> On Jul 11, 10:55=A0am, Kyle <kyle.r...@gmail.com> wrote:
>
> > Update: the 64/32 threw me a bit. =A0I installed the 32-bit MySQL, and
> > at least now, I'm getting "require 'mysql'" to return "true".
>
> > Sorry about that. =A0I'll see how it goes from here and let you know.
>
> > -Kyle
>
> > On Jul 11, 10:48=A0am, Kyle <kyle.r...@gmail.com> wrote:
>
> > > Thank you for your tips. =A0I'd rather not install Rails if possible =
-
> > > I'd have to re-write my scripts to use ActiveRecord, and from what I
> > > hear, it's not necessarily easy to get Rails to talk to
> > > MSSQL2005Express anyway...but I'll certainly give it a shot if nothin=
g
> > > else works!
>
> > > I installed the MySQL Essentials and am getting the following errors:
>
> > > > require 'mysql'
>
> > > LoadError: 193: %1 is not a valid Win32 application. =A0 =3D C:/Progr=
am
> > > Files/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
> > > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/mys=
ql-2.7.3-mswin32/
> > > ext/mysql.so
> > > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/rub=
ygems/
> > > custom_requirement.rb:32:in 'require'
>
> > > > mysql =3D DBI.connect('dbi:Mysql:.....')
>
> > > DBI::InterfaceError: Unable to load driver 'Mysql'
> > > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi=
rb:329:in
> > > 'load_driver'
> > > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi=
rb:227:in
> > > '_get_full_driver'
> > > =A0 =A0 =A0 =A0 from C:/Program Files/Ruby/lib/ruby/site_ruby/1.8/dbi=
rb:213:in
> > > 'connect'
>
> > > I hate to even think about this, but could this be an issue with Win
> > > XP x64? =A0That's what this machine is running... =A0I also had probl=
ems
> > > on a Win32 machine, though, with MySQL already installed. =A0I double=
-
> > > checked that the MySQL directory was in my PATH, too.
>
> > > Any other ideas? =A0I hadn't anticipated it being so difficult to get
> > > Ruby to talk to a MySQL database on Windows.
>
> > > -Kyle
>
> > > On Jul 11, 8:18=A0am, hemant <gethem...@gmail.com> wrote:
>
> > > > On Fri, Jul 11, 2008 at 8:20 AM, Kyle <kyle.r...@gmail.com> wrote:
> > > > > The short question: Has anybody successfully connected to both MS=
SQL
> > > > > 2005 Express and MySQL databases using Ruby on Windows XP? =A0How=
?
>
> > > > > The long description: My company's point-of-sale system uses MS S=
QL.
> > > > > A recent upgrade to the software required an upgrade of the datab=
ase.
> > > > > I was using ruby on ubuntu with DBI to synchronize the POS (MSSQL
> > > > > 2000) and site (MySQL) databases. =A0When I upgraded the POS data=
base to
> > > > > 2005 Express, using ODBC didn't work anymore - that is, until I g=
ot a
> > > > > driver from EasySoft that will cost 499 pounds if I want to use i=
t for
> > > > > more than 14 days.
>
> > > > > My next thought was, "Oh, I'll put ruby on Windows and use MS's O=
DBC
> > > > > driver to connect." =A0That worked fine, but now I'm having troub=
les
> > > > > getting to a MySQL database using DBI. =A0I can't seem to load th=
e
> > > > > module. =A0I get errors about LIBMYSQL.DLL not existing, and if I
> > > > > install the mysql gem, I get other errors (sorry - I'm not by tha=
t
> > > > > machine now).
>
> > > > > I'm using the Windows 1-click installer (186-26). =A0When I try t=
o build
> > > > > DBI, I get compile errors. I'm also unable to build the mysql-rub=
y (or
> > > > > ruby-mysql) package that the DBI resources seem to point to.
> > > > > Essentially, it looks like I'm having driver errors...or somethin=
g
> > > > > like that. =A0I'll try to give more info tomorrow.
>
> > > > > Does anybody have suggestions? =A0I'd really appreciate any help,=
and
> > > > > I'll be happy to respond with more info.
>
> > > > Your mysql problems has nothing to do with your sql server. You don=
't
> > > > have client libraries for mysql i believe.
>
> > > > Download "mysql essentials" from following page your mysql driver
> > > > issues should be gone:
>
> > > >http://dev.mysql.com/downloads/mysql/5.0....
>
>