MySQL and Perl Driver Issue - DBD::mysql: load_file:The specified module could not be found
<p>I've just started learning perl. So i am getting introduced to database connectivity here. For this i am using XAMPP server installed on my windows7 machine. Following is a sample piece of code that i have written for testing database.</p>

<pre><code>#!D:\xampp\perl\perl.exe
print " Enter Name : ";
chomp($name=&lt;STDIN&gt;);
print " Enter Age : ";
chomp($age=&lt;STDIN&gt;);

use DBI;

$dbh=DBI-&gt;connect('DBI:mysql:test');

$insert="insert into student values ('$name',$age)";
$d=$dbh-&gt;prepare($insert);
$d-&gt;execute();

$s="select * from student";
$s1=$dbh-&gt;prepare($s);
$s1-&gt;execute();

while(@v=$s1-&gt;fetchrow_array)
{
    print "$v[0] \t $v[1] \n";
}

$dbh-&gt;disconnect();
</code></pre>

<p>As you might be able to see that i'm using the test database available in the phpmyadmin database. i have created a student table with name and age as columns. But when i run this code in my browser i get the following error.</p>

<blockquote>
  <p>C:\Users\dellpc\Google Drive\coding\web>perl datab.pl<br>
  Enter Name : one
  Enter Age : 20 
  install_driver(mysql) failed: Can't load
  'D:/xampp/perl/vendor/lib/auto/DBD/mysql/mysql.dll' for module
  DBD::mysql: load_file:The specified module could not be found at
  D:/xampp/perl/lib/DynaLoader.pm line 190,  line 2.  at (eval 4)
  line 3. Compilation failed in require at (eval 4) line 3,  line
  2. Perhaps a required shared library or dll isn't installed where expected  at datab.pl line 9.</p>
</blockquote>

<p>I browsed over Google to find out what this error could mean. It seemed that i was missing a file called libmysql.dll , which i downloaded and copied in the xampp perl/bin and the perl/vendor/.../DBD directory as well but this did not help. </p>

<p>I also tried using older version of XAMPP , the issue still persists. Does anyone has any idea how to fix this? Thanks in advance. :)</p>

<p><strong>Edit 1:</strong></p>

<p>This is the error i get when i try install commands.</p>

<pre><code>&gt; cpan&gt; install DBI 
</code></pre>

<blockquote>
  <p>T/TI/TIMB/DBI-1.634.tar.gz   Has already been unwrapped into directory
  D:\xampp\cpan\build\DBI-1.634-HZNMVR Could not make: Unknown error
  Running make test   Can't test without successful make Running make
  install   Make had returned bad status, install seems impossible</p>
</blockquote>

<p>cpan> install DBD::mysql Running install for module 'DBD::mysql'</p>

<blockquote>
  <p>Running make for C/CA/CAPTTOFU/DBD-mysql-4.033.tar.gz   Has already
  been unwrapped into directory
  D:\xampp\cpan\build\DBD-mysql-4.033-3pgMhg<br>
  'D:\xampp\perl\bin\perl.exe Makefile.PL' returned status 512, won't
  make Running make test   Make had some problems, won't test Running
  make install   Make had some problems, won't installRunning install for module 'DBI' Running make for</p>
</blockquote>