Hi,
 This is the first time I am trying to use DBI module.
 When I try to connect to mysql db, I get the below error.
 ============================================================ 
 Error :
 Uncaught exception from user code:
        install_driver(mysql) failed: Can't locate loadable object for module DB
 D::mysql in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at (eval 6) 
lin
 e 3
 Compilation failed in require at (eval 6) line 3.
 Perhaps a module that DBD::mysql requires hasn't been fully installed
  at genTables.pl line 13
  at C:/Perl/lib/DBI.pm line 756
        DBI::install_driver('DBI', 'mysql') called at C:/Perl/lib/DBI.pm line 60
 0
        DBI::connect('DBI', 'dbi:mysql:database=test:host=localhost;mysql_emulat
 ed_prepare=0', 'root', '', 'HASH(0x226f48)') called at genTables.pl line 13
 ==========================================================================
 I have installed the mysql.pm, by doing the following :
  - downloaded the DBD-mysql-4.005.tar and copied the contents of lib to
    my C:\perl\lib.
 When I ran this program I can see my reference to mysql.
 ---------------------------------------------------
  print "Here's a list of DBI drivers:\n";
  my @available_drivers = DBI->available_drivers('quiet');
  my $driver;
  foreach $driver (@available_drivers)
  {
    print "$driver\n";
  }
 --------------------------------------------------------
 #Actual program to connect to db
 
 use strict ;
 use warnings ;
 use DBI ;
 use diagnostics ;
 #my $dbh = DBI->connect('DBI:mysql:cookbook') ;
 my $dbh = DBI->connect (
     "dbi:mysql:database=test:host=localhost;mysql_emulated_prepare=0",
     "root", "",
     { RaiseError => 1, PrintError => 0 },
     );
 $dbh->disconnect ;
 --------------------------------------------------------------------
 Not sure what's wrong.
Regards,
Alok


       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

Reply via email to