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