-   Linux - Newbie (
-   -   Problem with connecting Perl with mysql (

zak100 10-13-2013 01:09 PM

Problem with connecting Perl with mysql
I am trying to connect mysql with Perl. I am using windows 7 but i found that same problem occurs on some linux plat forms also. I got following message while connecting with mysql database:

install_driver(mysql) failed: Can't locate DBD/ in @INC (@INC contains:
C:/Perl64/site/lib C:/Perl64/lib .) at (eval 3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Pg, Proxy, SQL
ite, Sponge.
 at line 4.

I got one solution from the following site:
which says:

How to Install Perl DBD::MySQL, Use the following manual installation.

Below is the step,

Run from Shell.

perl -MCPAN -e shell

Type in,

cpan> install DBD::mysql

Wait for the installation.

Thats all!!

However when i executed "perl -MCPAN -e shell" command, i got following problem of locking:

C:\Users\HP>perl -MCPAN -e shell

It looks like you don't have a C compiler and make utility installed.  Trying
to install dmake and the MinGW64 gcc compiler using the Perl Package Manager.
This may take a a few minutes...

Downloading MinGW64-4.5.4...done
Downloading dmake-4.12.20090907...done
Unpacking MinGW64-4.5.4...done
Unpacking dmake-4.12.20090907...done
Generating HTML for MinGW64-4.5.4...done
Generating HTML for dmake-4.12.20090907...done
Updating files in site area...done
4601 files installed

Please use the `dmake` program to run commands from a Makefile!

Set up gcc environment - gcc.exe (rubenvb-4.5.4) 4.5.4 panic: Found invalid lockfile 'C:\Perl64\cpan\.lock', please remove. Can
not proceed.


Can somebody plz guide me? The download takes lot of time and internet connections are not so stable. Plz help me.


Robhogg 10-13-2013 01:18 PM

Well, one obvious issue is this line:

' panic: Found invalid lockfile 'C:\Perl64\cpan\.lock', please remove.'

You could move this file out of the cpan directory, and try the install again.

If this doesn't work, it might be worth trying a Windows forum, for example

On Linux, it might be better to install the versions of gcc and make supplied from your distro's repositories before trying the DBD install again.

zak100 10-13-2013 01:45 PM

Thanks for your response. I got the solution:

C:\Users\HP>ppm install DBD::mysql
Downloading DBD-mysql-4.022...done
Unpacking DBD-mysql-4.022...done
Generating HTML for DBD-mysql-4.022...done
Updating files in site area...done
  12 files installed


All times are GMT -5. The time now is 03:45 AM.