# Ruby DBI Help Needed

**URL:** <https://www.ruby-forum.com/t/ruby-dbi-help-needed/121329>\
**Category:** Ruby\
**Created:** [November 26, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/ruby-dbi-help-needed/121329 "2007-11-26T22:46:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyamal\_Mitra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@Shyamal\_Mitra](https://www.ruby-forum.com/u/Shyamal_Mitra)\
**Post date:** [November 26, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/ruby-dbi-help-needed/121329/1 "2007-11-26T22:46:06Z")

</div>

We have MySQL database version 4.1.7 and we recently installed  
the Ruby DBI module. When I run a simple script to connect to  
the database like:

#!/lusr/bin/ruby -w  
require ‘dbi’  
dbh = DBI.connect(“DBI:Mysql:database:localhost”, “user”, “password”)

I get the following error message:

/lusr/opt/ruby-1.8.4/lib/ruby/site\_ruby/1.8/dbi.rb:329:in `load_driver': Unable to load driver 'Mysql' (DBI::InterfaceError) from /lusr/opt/ruby-1.8.4/lib/ruby/site_ruby/1.8/dbi.rb:227:in`\_get\_full\_driver’  
from /lusr/opt/ruby-1.8.4/lib/ruby/site\_ruby/1.8/dbi.rb:213:in  
`connect’  
from ./dbs.rb:6

What do I need to do to get around that error. I need to write a Ruby  
script that will connect to my MySQL database. Thanks for your help.

- Shyamal
