471,078 Members | 812 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 software developers and data experts.

Need help, installing mysql in Perl v5.10.0

I have written a script to connect the mysql db

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl  -w
  3. use DBI;
  4. #definition of variables
  5. $db="MYTEST";
  6. $host="localhost";
  7. $user="root";
  8. $password="rootpass";
  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
11 5760
4,059 Expert 2GB
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
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
4,059 Expert 2GB
Try this:


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
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.

Sep 24 '08 #5
4,059 Expert 2GB
You're welcome
Sep 24 '08 #6
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
4,059 Expert 2GB
Can't you click on the "Suggested" box and see a list of repository names?
Dec 6 '08 #8
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
4,059 Expert 2GB
try adding a repository using the PPM GUI:

Dec 7 '08 #10
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
4,059 Expert 2GB
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.

Similar topics

175 posts views Thread by Sai Hertz And Control Systems | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.