title: Why do I get an error when I try to use Perl's DBD::mysql?
body: <p>I am trying to write data to a MySQL database using Perl.  However, when I run my script I get the error below:</p>
  
  <p><code>Can't locate loadable object for module DBD::mysql in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at LargeLDAPSearch.pl line 10.</code></p>
  
  <p>I do have these "use" statements and following code.  This is just a small excerpt, because the script worked before I tried a DB connection:</p>
  
  <pre><code>use DBD::mysql;
  use strict;
  use warnings;
  my $query_handle;
  
  my ($platform,$database,$host,$port,$db_user,$pw) = ("mysql","results","localhost","3306","root","mysql123");
  
  my $dsn = "dbi:$platform:$database:$host:$port";
  
  my $connect = DBI-&gt;connect($dsn,$db_user,$pw) || die "Could not connect to database";
  
  my $query_insert = "INSERT INTO " . $dbname . "(uid,status,lstpwdset,reset) VALUES (" . $strSAMA . "," . $strAcctControl . "," . $pwLS . "," . $reset . ")";
  
  $query_handle = $connect-&gt;prepare($query_insert);
  $query_handle-&gt;execute();
  </code></pre>
  
  <p>I have gone into my Perl folder on my local, and searched the lib file
  directory.  In the <code>/lib/</code> subfolder, I have two folders, a DBI and a DBD
  subfolder, and I have MySQL subfolder in DBD and also a DBD subfolder with a
  MySQL subfolder under DBI.  <code>/lib/DBD/mysql/</code> &amp; `/lib/DBI/DBD/mysql/``</p>
  
  <p>This could be the error, fodlers in two spots.  I went to the CPAN website, and have tried the manual isntall steps, and i receive an install error of DBI regarding SQLLite.</p>