Need help, installing mysql in Perl v5.10.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bthalapathi
    New Member
    • Sep 2008
    • 5

    Need help, installing mysql in Perl v5.10.0

    I have written a script to connect the mysql db

    Code:
    #!/usr/bin/perl  -w
    
    use DBI;
    #definition of variables
    $db="MYTEST";
    $host="localhost";
    $user="root";
    $password="rootpass";
    
    #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\Admini strator>ppm install DBD::mysql
    Downloading ActiveState Package Repository packlist...not modified
    No missing packages to install

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

    C:\Documents and Settings\Admini strator>

    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
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

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

    Comment

    • bthalapathi
      New Member
      • Sep 2008
      • 5

      #3
      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\li b\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.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Try this:

        START>>PROGRAMS >>ACTIVEPERL>>P PM

        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.

        Comment

        • bthalapathi
          New Member
          • Sep 2008
          • 5

          #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

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            You're welcome

            Comment

            • deh3215
              New Member
              • Dec 2008
              • 3

              #7
              why i can't see "Add Repository&quot ;?

              Originally posted by bthalapathi
              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
              It's very clear,but why I don't have "Add Repository"?and "uwinnipeg","tr ouchelle'"?

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

              Comment

              • KevinADC
                Recognized Expert Specialist
                • Jan 2007
                • 4092

                #8
                Can't you click on the "Suggested" box and see a list of repository names?

                Comment

                • deh3215
                  New Member
                  • Dec 2008
                  • 3

                  #9
                  Originally posted by KevinADC
                  Can't you click on the "Suggested" box and see a list of repository names?
                  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'"

                  Comment

                  • KevinADC
                    Recognized Expert Specialist
                    • Jan 2007
                    • 4092

                    #10
                    try adding a repository using the PPM GUI:

                    http://theoryx5.uwinni peg.ca/ppms/
                    http://www.bribes.org/perl/ppm
                    http://trouchelle.com/ppm/

                    Comment

                    • deh3215
                      New Member
                      • Dec 2008
                      • 3

                      #11
                      Originally posted by KevinADC
                      try adding a repository using the PPM GUI:

                      ActivePerl 8xx Win32 PPM packages
                      Index of /perl/ppm
                      Index of /ppm
                      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! ^^"

                      Comment

                      • KevinADC
                        Recognized Expert Specialist
                        • Jan 2007
                        • 4092

                        #12
                        Looks like you need to install a higher version of DBD::mysql

                        Comment

                        Working...