Forum: Ruby Unable to load driver 'Mysql' (underlying error: uninitializ

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Arun K. (Guest)
on 2009-03-13 07:09
Attachment: test.rb (0 Bytes)
I'm a freser to ruby and i'm trying to workout certain database related
examples using dbi. But when i run the file i receive an error :

Unable to load driver 'Mysql' (underlying error: uninitialized constant
DBI::DBD::MySql) (DBI::InterfaceError)
  from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
  from /home/arunkumar/.gem/ruby/1.8/gems/dbi-0.4.1/lib/dbi.rb:236:in
  from /home/arunkumar/.gem/ruby/1.8/gems/dbi-0.4.1/lib/dbi.rb:154:in
  from /home/arunkumar/.gem/ruby/1.8/gems/dbi-0.4.1/lib/dbi.rb:139:in

The error occurs from the line given to connect the mysql database. ie.
dbh = DBI.connect("DBI:MySql:Project:localhost",
                      "username", "password")

Can anybody please help me to solve this problem.

Arun K. .C.M.
This topic is locked and can not be replied to.