[ruby-dbi-users] Mysql Driver Load error

Erik Hollensbe erik at hollensbe.org
Fri Nov 28 02:42:16 EST 2008

On Thursday 27 November 2008 22:41:06 Makarand Maslekar wrote:
> Hi ,
> I am using the ruby mysql connectivity using the DBI on windows platform. I
> am getting the error when i use the dbi to connect to mysql.
> The error says
> c:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:286:in `load_driver':
> Unable to load driver 'Mysql' (DBI::InterfaceError)
>     from c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
>     from c:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:236:in
> `load_driver'
>     from c:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:154:in
> `_get_full_driver'
>     from c:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.0/lib/dbi.rb:139:in
> `connect'
> So can some one help me or provide me the exact steps to resolve this
> issue?

A couple of things to try:

1) Have you installed the dbd-mysql gem?
2) If that doesn't work, the error message isn't going to be very helpful; 
that's something I'm going to attempt to fix tonight after I finish with the 
rest of the 1.9.1p1 fixes, and will be released in 0.4.1. Windows testing is 
somewhat problematic for me to do, so if you could try a few things, that'd 
be great:

  run this:

  gem 'dbd-mysql'
  require 'dbd/Mysql'

  p DBI::DBD::Mysql.constants

Do you get an error? If not, what is the output?


More information about the ruby-dbi-users mailing list