Home: Perl Programming Help: DBI:
Need help, installing mysql in Perl v5.10.0

New User

Sep 23, 2008, 6:05 AM

Views: 6554
Need help, installing mysql in Perl v5.10.0

I have written a script to connect the mysql db

#!/usr/bin/perl  -w 

use DBI;
#definition of variables

#connect to MySQL database
my $dbh = DBI->connect ("DBI:mysql:database=$db:host=$host:3366",$user,$password)
or die "Can't connect to database: $DBI::errstr\n";

as specified mysql port is 3366 not 3306

but this returns with error,

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .
) at (eval 4) 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, Proxy, SQLite, Sponge.
at sample.pl line 11

But I already installed DBD::mysql

C:\Documents and Settings\Administrator>ppm install DBD::mysql
Downloading ActiveState Package Repository packlist...not modified
No missing packages to install

C:\Documents and Settings\Administrator>ppm verify DBD::mysql
ppm verify failed: Package 'DBD::mysql' is not installed

C:\Documents and Settings\Administrator>

I'm using perl version, 5.10.0 built for MSWin32-x86-multi-thread

Any help will be appreciated, Thanks in advanced for all your help

New User

Sep 24, 2008, 2:58 AM

Views: 6533
Re: [bthalapathi] Need help, installing mysql in Perl v5.10.0

Finally it is working, I had followed the instructions of championrpg and KevinADC. Lot of thanks Guys.

I followed the below

Start -> Run -> PPM , this opens the PPM GUI and

Edit -> Preferences -> Repositories -> Add Repository

First I selected 'uwinnipeg' it was not listed the DBD:mysql then I selected 'bribes' and this too not helped but selecting 'trouchelle' finally listed DBD:mysql which helped me to continue.

After selecting 'trouchelle', I pressed CTRL+1 and found DBD-mysql. Then right click on DBD-mysql and chosen 'Install DBD-mysql XX +'. Went to menu File > Run Marked Actions. Done.

Then I ran the script I mentioned in my first post, it works like a charm.

Again thanks for all your help.