Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Issues with DBD::mysql - please help

by drohr (Acolyte)
on Jun 20, 2014 at 19:57 UTC ( [id://1090685]=perlquestion: print w/replies, xml ) Need Help??

drohr has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am using activestate perl 5.16.3 on win7-64. This version of perl came with DBI, but it did not come with DBD::mysql. i used the ppm to search for DBD-mysql, but but it was not listed (other versions were there; csv, odbc, etc). so i went to cpan and downloaded the module from this link:
http://search.cpan.org/~capttofu/DBD-mysql-4.027/lib/DBD/mysql.pm

i extracted the files and copied them in the following directories:
- mysql.pm -> C:\Perl64\lib\DBD - mysql\GetInfo.pm -> C:\Perl64\lib\DBD\mysql - mysql\INSTALL.pod -> C:\Perl64\lib\DBD\mysql
here is a stripped down code snippet of how i am using DBI
use DBI; my $url = sprintf('DBI:%s:%s:%s', $driver, $database, $hostname); my $dbh = DBI->connect( $url, $username, $password, {RaiseError => 1, AutoCommit => 1} )
when i run that code, i get the following error:
install_driver(mysql) failed: Can't locate loadable object for module +DBD::mysql in @INC (@INC contains: ../ C:\Program Files (x86)\ActiveS +tate Komodo IDE 8\lib\support\dbgp\perllib c:/Perl64/site/lib c:/Perl +64/lib .) at (eval 31)[c:/Perl64/lib/DBI.pm:783] line 3. Compilation failed in require at (eval 31)[c:/Perl64/lib/DBI.pm:783] l +ine 3. Perhaps a module that DBD::mysql requires hasn't been fully installed
i know the DBD-mysql files are in the correct paths, but it sounds like this module isnt installed correctly? what am i missing here? does DBD-mysql work with 5.16.3? i know that i have used that module in earlier versions of perl.

thanks,

Replies are listed 'Best First'.
Re: Issues with DBD::mysql - please help
by blue_cowdawg (Monsignor) on Jun 20, 2014 at 20:34 UTC

    Do you have a mysql client installed on your PC along with its libraries? (taking a stab in the dark here..)


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
      yes i do.
            yes i do.

        I'd see if the folks over at Strawberry have any ideas then. I stopped using Strawberry Perl a long time ago due to some wonkiness I experienced.


        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: Issues with DBD::mysql - please help
by fishmonger (Chaplain) on Jun 20, 2014 at 20:47 UTC

    The ppd is in the Bribes repository.

    ppm install http://www.bribes.org/perl/ppm/DBD-mysql.ppd
      yes, i tried both commands:
      C:\Users\me>ppm install http://www.bribes.org/perl/ppm/DBD-mysql.ppd
      ppm install failed: 500 Can't connect to www.bribes.org:80 (10061)

      C:\Users\me>ppm install DBD-mysql
      ppm install failed: Can't find any package that provides DBD-mysql

        Can you ping www.bribes.org?

        C:\>ping /n 1 www.bribes.org Pinging www.bribes.org [151.236.47.137] with 32 bytes of data: Reply from 151.236.47.137: bytes=32 time=146ms TTL=44 Ping statistics for 151.236.47.137: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 146ms, Maximum = 146ms, Average = 146ms

        I can also reach port 80 and load the page in browser.

        C:\>nmap -p80 www.bribes.org Starting Nmap 6.25 ( http://nmap.org ) at 2014-06-20 14:13 Pacific Day +light Time Nmap scan report for www.bribes.org (151.236.47.137) Host is up (0.034s latency). rDNS record for 151.236.47.137: bribes.org PORT STATE SERVICE 80/tcp open http Nmap done: 1 IP address (1 host up) scanned in 0.46 seconds

        I can also hit it with ppm.

        C:\>ppm install http://www.bribes.org/perl/ppm/DBD-mysql.ppd Installing package 'http://www.bribes.org/perl/ppm/DBD-mysql.ppd'... Error installing package 'http://www.bribes.org/perl/ppm/DBD-mysql.ppd +': Read a PPD for 'http://www.bribes.org/perl/ppm/ DBD-mysql.ppd', but it is not intended for this build of Perl (MSWin32 +-x86-multi-thread-64int-5.18)
Re: Issues with DBD::mysql - please help
by aitap (Curate) on Jun 21, 2014 at 05:14 UTC

    i extracted the files and copied them in the following directories:
    This is not a correct way to install modules, especially if there is XS code. If all else fails (i.e. if you fail to get the binary package from places suggested by others), you'll need to install the compiler suite (ppm install MinGW) and compile the module:
    perl Makefile.PL dmake dmake install

    You can also use cpan or cpanm to automatically track and install module dependencies, if any are required. For more info, check http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl.

      hey guys, thanks for all the feedback. it turned out that my work blocks the URL for the ppm repository. i installed 5.16 at home, found the DBD::mysql module in the ppm, installed it, then copied the installed files to my work computer and it all works as expected. thanks again,
      would it be possible for someone to send me all the installed files from the DBD-mysql installation so that I can use them? I have already gone down the activestate perl 5.16 path in my development and this is the last module that I need to get working. it would be a lot of work to switch to another database driver or another version of perl.

      thanks,
Re: Issues with DBD::mysql - please help
by poj (Abbot) on Jun 20, 2014 at 20:38 UTC
    Did you try  ppm install DBD-mysql from the command line ?
    poj
Re: Issues with DBD::mysql - please help
by Bodger (Acolyte) on Jun 20, 2014 at 23:52 UTC
    Howdy,

    At my last firm we used ActiveState for 8-10 years. But they recently started end of lifeing versions of perl more then 2 steps from current.

    And with the 64 bit perls they were getting less and less CPAN modules available, especially the ones we needed to operate with.

    We gave up and went to Strawberry Perl, if you want 64 bit you really are asking for pain by staying with ActiveState.

    Good luck on that though.

    Bodger

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1090685]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found