Install DBI-mysql for Perl 5.18.xx [duplicate] - perl

This question already has answers here:
issues installing perl DBI-mysql in windows
(3 answers)
Closed 8 years ago.
I am using perl 5.18.1.1800 with ppm 4.19 in a Windows 7 64 bit machine.
I need to use DBD-mysql to be able to access mysql from perl. But I get below error message:
use DBI();
my $dbh = DBI->connect("DBI:mysql:database=mydbname;host=localhost","myuser", "mypass",{'RaiseError' => 1})
install_driver(mysql) failed: Can't locate DBD/mysql.pm in #INC (you
may need to install the DBD::mysql module)
So i tried to install DBD-mysql, but i don't have that listed in my PPM. In command line, when I tried to install, i get below error
ppm install DBD-mysql
ppm install failed: Can't find any package that provides DBD-mysql
I tried to download and install it, but it requires a C compiler which I don't have.
From DBD-mysql info page, there is no mentioning of Perl 5.18 support for the module.
So, should I revert back to 5.16.xx or the problem is something else?
Thanks,

DBD-mysql is available for ActivePerl-5.16.3.1604. Reverting back to that version is probably simpler than installing a compiler to build the package yourself.
Activestate used Visual Studio to build DBD-mysql: http://ppm4.activestate.com/MSWin32-x86/5.16/1600/C/CA/CAPTTOFU/DBD-mysql-4.022.d/log-20120830T032945.txt
C:\>ppm install DBD-mysql
Downloading ActiveState Package Repository packlist...done
Updating ActiveState Package Repository database...done
Syncing site PPM database with .packlists...done
Downloading DBD-mysql-4.022...done
Unpacking DBD-mysql-4.022...done
Generating HTML for DBD-mysql-4.022...done
Updating files in site area...done
12 files installed

The name of the module is DBI. Try using:
ppm install DBI
*Disclaimer: I haven't used Perl on Windows, rather Perl on Linux, so I assumed the syntax for using ppm is "ppm install modulename".
also, the correct syntax hereafter would be:
my $dbh = DBI->connect(DBI:mysql:DBNAME, $username, $pass, {RaiseError => 1, AutoCommit
=> 1}) or die "Could not Connect to DB";

Related

ppm.bat install failed: Can't find any package that provides GD-Graph3d

Getting an exception while installing Perl package through below command. Running Perl 5.26 on Windows 10.
ppm install GD-Graph3d
ppm.bat install failed: Can't find any package that provides GD-Graph3d
The ActiveState build for GD::Graph3d fails since Perl 5.24. See also the patch that ActiveState try to apply. Maybe you can install the module by using the cpan tool instead?
cpan GD::Graph3d

Arch Linux Perl. (Data Dumper) undefined symbol Perl_xs_apiversion_bootcheck

Since a recent update Perl fails to execute most of the scripts on my Arch Linux System.
Most of the time it failes due to a undefined Symbol in the Data::Dumper module. Other times it is because of the Parser.so with the same undefined symbol Perl_xs_apiversion_bootcheck
Perl v5.22.0
Data::Dumper is up to date (2.154).
Full Error:
/usr/bin/perl: symbol lookup error: perl5/lib/perl5/x86_64-linux-thread-multi/auto/Data/Dumper/Dumper.so: undefined symbol: Perl_xs_apiversion_bootcheck
I already tried to reinstall the Modules, did not help.
I found this thread:
Error running Perl script on 2 different computers
They talk about the problems of differen perl versions, which I do not seem to have here.
Any other ideas? (Reinstall the perl as whole looks impossible for from here...)
Thanks
Arch Linux recently upgraded from Perl 5.20 to Perl 5.22. Those are not ABI compatible, so any XS modules installed for Perl 5.20 need to be rebuilt, or you'll get errors like the one you're describing.
Arch's perl-5.22.0-1 package includes Data::Dumper 2.158. Since you say you have 2.154, you must have manually installed an upgrade to Data::Dumper for Perl 5.20. You need to remove that (now obsolete) version.
Does pacman -Qi perl-data-dumper report anything? If it does, you might try pacman -R perl-data-dumper.
Update: It seems you've been installing modules into your system Perl directories using cpan. That winds up mixing files installed by pacman and files installed by cpan, which is why it's not recommended.
You should consider installing CPANPLUS::Dist::Arch and using cpanp instead. You can do this with:
sudo pacman -S perl-cpanplus-dist-arch
setupdistarch
After that, installing modules with cpanp will build a package file and install it with pacman. You can then use pacman to uninstall them.

Can't run checksetup.pl for BugZilla requires ppm install DBI

I'm following the installation guide for BugZilla at https://wiki.mozilla.org/Bugzilla:Win32Install.
I'm trying to install BugZilla on my Windows 2008 server. I've installed Perl 4.17, Apache for windows 2.2.25 and BugZilla 4.4.1. I'm at the point of running the command
C:\bugzilla>perl checksetup.pl
But when I run this command I get
I've then tried to install the package using
ppm install DBI
but I get the message saying "No missing packages to install"
Where am I going wrong ?
For me the main issue was that it thinks 1.614 is more than 1.63
In the console output, in red:
Checking for DBI (v1.614) found v1.63
I changed Requirements.pm by requiring 1.63 for the said module. Thanks #Tommo1977
I managed a work around by commenting out the version check. It appears that this is a bug
https://bugzilla.mozilla.org/show_bug.cgi?id=938300
Just had this problem on Windows Server 2012 using Bugzilla 4.4.1 and ActivePerl 5.16.3.1603.
Solved by removing one of the two DBI packages using ppm UI. Just type 'ppm' in command line and then remove one DBI package.
The version checking for DBI can be commented out in C:\Bugzilla\Bugzilla\Install\Requirements.pm
#{
# package => 'DBI',
# module => 'DBI',
# version => (vers_cmp($perl_ver, '5.13.3') > -1) ? '1.614' : '1.41'
#},

Perl Install PAR:Packer Problems

My perl version is 5.16.2 on my Windows 7 64bit, I failed to install PAR:Packer. I tried active perl and strawberry perl , both got the same error. Can you please give me some suggestion. Below is my experience:
I tried ppm install PAR:Packer, version 1.013, But when I use pp, I got the error:
Perl lib version (5.16.2) doesn't match executable version (v5.16.0).
I also tried cpan install PAR:Packer, version 1.014. But I got the error during installation. The pop up window says: par.exe has stopped working. Then command prompt got the error:
C:\Perl64\bin\perl.exe -Mblib run_with_inc.pl par.exe -q -B -Oparldyn.exe
system(par.exe -I C:\Users\PAR-Packer-1.014\blib\arch -I C:\Users\PAR-Packer-1.014\blib\lib - IC:/Perl64/site/lib -IC:/Perl64/lib -I. -q -B -Oparldyn.exe) failed:
dmake.exe: Error code 255, while making 'parldyn.exe'
dmake.exe: Error code 255, while making 'subdirs'
I have googled extensively, but as of yet haven't been able to find a solution, any help is greatly appreciated, thanks a lot!
I simply changed the line 60 in .../perl64/Config.pm from
`$^V eq 5.16.3`
to
`$^V eq 5.16.3 or $^V eq 5.16.0`
and voila! My par-packer module 1.013 installed through ppm (ActiveState Perl 5.16.3) works ...
I'll start off with my own environment:
Windows 7 x64 en_US
Strawberry Perl v5.16.2 32bit
I just confirmed that I do have PAR::Packer working on my environment. I'm running PAR::Packer version 1.014.
There is a bug logged about PAR::Packer 1.013 failing to build on certain environments. The bug is logged on CPAN here: https://rt.cpan.org/Public/Bug/Display.html?id=77408
I recommend trying one of the following paths forward (based on your build version requirements):
Install PAR::Packer 1.0.14.
Install the patched version of PAR::Packer 1.013 that is available at http://strawberryperl.com/package/kmx/perl-modules-patched/PAR-Packer-1.013_patched.tar.gz
To build you will need any dependencies as well. Hopefully those work just fine through CPAN.
Download either the patched version listed above or the latest version from the CPAN site, then execute:
perl Makefile.pl
dmake
dmake test
dmake install
Keep in mind PAR::Packer requires a C/C++ compiler to build.
I ran into this exact same error scenario with Perl 5.16.3 on my Windows 7 64 bit machine. I started my Perl tinkering with ActiveState and later installed other related programs like Komodo Edit and finally installed StrawberryPerl. After reading quite a few of these online posts I tried the manual dmake methods and whatever other suggestions I could find. I then tried uninstalling ActiveState. That didn't help either. Finally, I went on an uninstall binge and found that after uninstalling all of the ActiveState and Komodo applications (along with a bunch of other stuff I wasn't using anymore) I was able to successfully install and use pp in two simple steps from the cpan prompt:
install CPAN
install pp
I was going to uninstall and re-install StrawberryPerl next but didn't have to. The install CPAN may not be necessary but it was suggested in the log output in one of my previously failed attempts so I figured I'd try that first. Hope this saves someone all the hassle I went to as a begginer.

Perl DBD::Oracle Module installation

Could someone guide me how to install the Perl DBD::Oracle module?
Here is what I have done so far:
Platform: RHEL 5.8 64 bit
Installed Perl DBI package
Installed Oracle Instant client for Linux 64 bit (basi + sdk + sqlplus component for the instant client
Have set the correct $ORACLE_HOME and $LD_LIBRARY_PATH
Then when I do perl Makefile.pl it fails with the following error:
I'm having trouble finding your Oracle version number... trying harder
WARNING: I could not determine Oracle client version so I'll just
default to version 8.0.0.0. Some features of DBD::Oracle may not work.
Oracle version based logic in Makefile.PL may produce erroneous results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.
Oracle version 8.0.0.0 (8.0)
DBD::Oracle no longer supports Oracle client versions before 9.2
Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.PL line 271.
The instant client version: 11.1.0
The DBD::Oracle version is 1.44
If you have installed successfully with the Oracle instant client, then could you please let me know what am I missing?
Is it possible to install DBD::Oracle without using the Oracle instant client?
Install if missing ExtUtils-MakeMaker module (sudo yum install perl-ExtUtils-MakeMaker)
Install Perl DBI module ($ yum install perl-DBI)
Manually install below three RPMs for Oracle instant client (from Instant Client Downloads for Linux x86-64. The example is for v11.2.0.3.0-1: adapt the commands below to the actual version.)
oracle-instantclient11.2-basic-11.2.0.3.0-1
oracle-instantclient11.2-devel-11.2.0.3.0-1
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1
I am using 64 bit Linux box, so select your RPM filenames accordingly. Something like sudo yum -y install oracle-instantclient*rpm should do)
set below variables:
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
MacOS users will need:
DYLD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/
Also add ORACLE_HOME to your PATH variable.
download DBD::Oracle from CPAN
untar the module and run below commands in given sequence:
perl Makefile.PL
make
sudo make install
In case you get complaints about missing gcc you can (temporarily) install it and then remove it.
DONE !!!
Issues I had faced were due to the wrong LD_LIBRARY_PATH. I had set it to /usr/lib/oracle/11.2/client64 whereas the correct value is /usr/lib/oracle/11.2/client64/lib.
Certainly, this was a great learning for a newbie like me.
you can also read my article How to install DBD::Oracle which contains all the steps required to install DBD::Oracle CPAN module, which is not a straightforward installation. The purpose is to reduce headache and turn it into a repeatable process.
Here's what I did on CentOS 7.2 using yum packages and CPAN. This assumes you're using Oracle version 12.1 but I would imagine most versions will work this way.
Install Oracle Instant Client
yum install oracle-instantclient12.1-basic-12.1.0.2.0-1 oracle-instantclient12.1-devel-12.1.0.2.0-1 oracle-instantclient12.1-sqlplus-12.1.0.2.0-1
Copy demo make files
The install expects the *.mk file to be in /usr/share/oracle/12.1/client64 but the yum package install puts them in /usr/share/oracle/12.1/client64/demo.
sudo cp /usr/share/oracle/12.1/client64/demo/* /usr/share/oracle/12.1/client64
Modify .bashrc
Add the following lines to your ~/.bashrc
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
export PATH=$ORACLE_HOME:$PATH
Now source the file
source ~/.bashrc
Update CPAN and DBI
Update CPAN and DBI to the latest
cpan> install CPAN
cpan> reload cpan
cpan> install DBI
Install DBD::Oracle
cpan> install DBD::Oracle
A little addition to slayedbylucifer answer. I had the same problem like mentioned in the question. I've done all the steps described by slayedbylucifer. But still I got the problem like mentioned here:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /opt/oracle/app/oracle/product/11.2.0/client_1/lib//libclntsh.so when searching for -lclntsh
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lclntsh
So I created the following symbolic link:
ln -s /opt/oracle/app/oracle/product/<YOUR_ORACLE_VERSION>/client_1/lib/libclntsh.so $ORACLE_HOME/libclntsh.so*
After that step the error from above (cannot find -lclntsh) was fixed. The execution of the make command was without any errors.
The only problem I still have is that I don't understand why this symbolic link is necessary.