By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

Need help, installing mysql in Perl v5.10.0

P: 5
I have written a script to connect the mysql db

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl  -w
  2.  
  3. use DBI;
  4. #definition of variables
  5. $db="MYTEST";
  6. $host="localhost";
  7. $user="root";
  8. $password="rootpass";
  9.  
  10. #connect to MySQL database
  11. my $dbh   = DBI->connect ("DBI:mysql:database=$db:host=$host:3366",$user,$password)
  12.                           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
Sep 23 '08 #1
Share this Question
Share on Google+
11 Replies


KevinADC
Expert 2.5K+
P: 4,059
It appears your install DBD::mysql was not successful. Look in the DBD folder in the perl/lib or perl/site/lib folder and see if it is there.
Sep 23 '08 #2

P: 5
Thanks for your reply.

Yes, the DBD:mysql is not installed successfully. The mysql.pm is not available either in C:\Perl\lib\DBD or C:\Perl\site\lib\DBD

Through google I find that we have to execute 'ppm install DBD:mysql' in the command prompt to install DBD:mysql. But this is not helpful for me for some reason.

I don't know the way to install DBD:mysql successfully. Is there any alternative way to install the DBD:mysql? Please help me to install DBD:mysql in my v5.10 Perl.

Thanks in Advance for all your help.
Sep 24 '08 #3

KevinADC
Expert 2.5K+
P: 4,059
Try this:

START>>PROGRAMS>>ACTIVEPERL>>PPM

Once thePPM GUI is running click on the EDIT tab, then PREFERENCES, then click on the REPOSITORIES tab then on the SUGGESTED tab select "uwinnipeg" and click on ADD. After the uwinnipeg packages are viewable see if DBD-mysql is listed. If not try the same thing and add "bribes" to the list of repositories. Once the DBD-mysql module is listed mark it for install then install it. Read the PPM help files if my instructions are confusing.
Sep 24 '08 #4

P: 5
Finally it is working, ofcourse following your instructions. Lot of thanks KevinADC.

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.

thala
Sep 24 '08 #5

KevinADC
Expert 2.5K+
P: 4,059
You're welcome
Sep 24 '08 #6

P: 3
@bthalapathi
It's very clear,but why I don't have "Add Repository"?and"uwinnipeg","trouchelle'"?


I have the same problem Orz...and I can't solve it.
can you help me? thanks a lot ^^
Dec 6 '08 #7

KevinADC
Expert 2.5K+
P: 4,059
Can't you click on the "Suggested" box and see a list of repository names?
Dec 6 '08 #8

P: 3
@KevinADC
I can't see any list of of repository names.
I used CPAN(by CMD) and PPM(By CMD and PPM console) to instal DBD::Mysql,but still "ppm verify failed: Package 'DBD::mysql'"
Dec 7 '08 #9

KevinADC
Expert 2.5K+
P: 4,059
try adding a repository using the PPM GUI:

http://theoryx5.uwinnipeg.ca/ppms/
http://www.bribes.org/perl/ppm
http://trouchelle.com/ppm/
Dec 7 '08 #10

P: 3
@KevinADC
ha I solve the problem!but now I have another problem
"DBD::mysql" object version 4.005 does not match bootstrap parameter 4.010 at c:/perl/lib/DynalLoader.pm
the above problem I will try to solve it.
Thanks for your help! ^^"
Dec 7 '08 #11

KevinADC
Expert 2.5K+
P: 4,059
Looks like you need to install a higher version of DBD::mysql
Dec 9 '08 #12

Post your reply

Sign in to post your reply or Sign up for a free account.