I am constantly failing in installing DBD::mysql.
The command I used was:
brew install mysql
cpanm DBD::mysql
The error I got was:
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... N/A
! Configure failed for DBD-mysql-4.050. See /Users/jeji/.cpanm/work/1642350924.83890/build.log for details.
Therefore, I checked by log file. My log file read:
cpanm (App::cpanminus) 1.9018 on perl 5.030003 built for darwin-thread-multi-2level
Work directory is /Users/jeji/.cpanm/work/1642350924.83890
You have make /usr/bin/make
You have LWP: 6.44
You have LWP::Protocol::https: 6.07
You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
Searching DBD::mysql () on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
-> OK
Unpacking DBD-mysql-4.050.tar.gz
Entering DBD-mysql-4.050
Checking configure dependencies from META.json
Checking if you have DBI 1.609 ... Yes (1.643)
Checking if you have Data::Dumper 0 ... Yes (2.174)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Devel::CheckLib 1.09 ... Yes (1.14)
Configuring DBD-mysql-4.050
Running Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'jeji' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'jeji'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/Cellar/mysql/8.0.27_1/include/mysql
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/Cellar/mysql/8.0.27_1/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = jeji
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
Can't link/include C library 'ssl', 'crypto', aborting.
-> N/A
Checking dependencies from META.json ...
Checking if you have Time::HiRes 0 ... Yes (1.9760)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have Test::Deep 0 ... Yes (1.130)
Checking if you have Test::Simple 0.90 ... Yes (1.302162)
Checking if you have bigint 0 ... Yes (0.51)
Checking if you have DBI 1.609 ... Yes (1.643)
-> FAIL Configure failed for DBD-mysql-4.050. See /Users/jeji/.cpanm/work/1642350924.83890/build.log for details.
I do think that 'Can't link/include C library 'ssl', 'crypto', aborting.
-> N/A' is the part that is causing the issue, but I have no clue in how to approach the problem.
Any solutions would be great!
Thanks in advance :)
Here's how I got DBD::mysql installed on macOS:
cpan -T DBI
sudo cpanm DBD::mysql -n \
--configure-args="--libs='-L/usr/local/opt/openssl/lib -lssl -lcrypto -lperconaserverclient'"
I was installing Percona Server instead of MySQL so you might not need the last option.
Update: In more recent releases of MacOS, I can't get this to work. I tried for a few days to resolve the compile errors, but then I gave up. I'll use Python now. The era of Perl is over, which makes me sad because I've enjoyed using Perl since around 1996.
Related
When running this command: perl -MCPAN -e 'install DBD::mysql' I get a really long output of different errors:
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 89.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
I will use the following settings for compiling and testing:
cflags (guessed) = -I/usr/local/mysql/include
embedded (guessed) =
libs (guessed) = -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lcrypt -lnsl
mysql_config (guessed) = mysql_config
nocatchstderr (default) = 0
nofoundrows (default) = 0
nossl (default) = 0
testdb (default) = test
testhost (default) =
testpassword (default) =
testport (default) =
testsocket (default) =
testuser (guessed) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
dyld: Library not loaded: #rpath/libmysqlclient.21.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-5/assertlib3PEYQc80
Reason: image not found
Can't link/include C library 'crypt', 'nsl', aborting.
Warning: No success on command[/usr/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
There seems to be quite a few posts and articles on this kind of error but the solutions all seem to be Linux focussed. I think the key part of this is that I need a mysql_config file but I have no idea where to start on this!
MacOS is 11.5.2. Perl is 5.30.2. MySQL is 8.0.26.
Thanks in advance!
Update:
Adding the specific mysql directory to my path as suggested in the comments below has got me a little further along but I'm getting a whole different set of errors now:
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/mysql-8.0.26-macos11-x86_64/include
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/mysql-8.0.26-macos11-x86_64/lib -lmysqlclient -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
dyld: Library not loaded: #rpath/libmysqlclient.21.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib3PoRLEqr
Reason: image not found
dyld: Library not loaded: libssl.1.1.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib_CG2WA4d
Reason: image not found
dyld: Library not loaded: libcrypto.1.1.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib0lH0wftp
Reason: image not found
wrong result: 'mysqlclient', 'ssl', 'crypto'
Warning: No success on command[/usr/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Update 2:
Following advice from the comments below I've switched to perlbrew and after one failure I've now finally got it installed (it took about 45 mins each time). Running my script now using perlbrew exec perl oncourt_update.pl now returns the original error: install_driver(mysql) failed: Can't locate DBD/mysql.pm in #INC. I've tried an installation using perlbrew use perl-5.34.0; cpan DBD::mysql however I get the following output:
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/Cellar/mysql/8.0.26/include/mysql
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/Cellar/mysql/8.0.26/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
Can't link/include C library 'ssl', 'crypto', aborting.
Warning: No success on command[/Users/philipjoss/perl5/perlbrew/perls/perl-5.34.0/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/Users/philipjoss/perl5/perlbrew/perls/perl-5.34.0/bin/perl Makefile.PL -- NOT OK
Looking at the output the line mysql> grant all privileges on test.* to 'philipjoss'#'localhost' looks strange as philipjoss isn't the username for localhost. Could this be something to do with the error? I note that the output states:
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.```
I installed munin-node on CentOS 7. The default plugin to monitor system resources is working fine. I followed the steps online to enable the mysql_ plugin. However, I'm encountering the following error:
> sudo munin-run --debug mysql_
# Skipping systemd properties simulation due to lack of permissions.
# Processing plugin configuration from /etc/munin/plugin-conf.d/00-default
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/mysql
# Setting /rgid/ruid/ to /4257/498/
# Setting /egid/euid/ to /4257 4257/498/
# Setting up environment
# Environment mysqlpassword = password
# Environment mysqlconnection = DBI:mysql:information_schema;mysql_read_default_file=/etc/my.cnf
# Environment mysqluser = munin
# Environment mysqladmin = /usr/bin/mysqladmin
# About to run '/etc/munin/plugins/mysql_'
Unknown graph at /etc/munin/plugins/mysql_ line 1805.
It seems to be an issue with the plugin code itself. Has anyone else encountered a similar issue and/or has a fix?
Setup steps
$ sudo yum install munin-node
$ sudo ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_
Create /etc/munin.plugin-conf.d/mysql with:
[mysql*]
env.mysqlconnection DBI:mysql:information_schema;mysql_read_default_file=/etc/my.cnf
env.mysqluser munin
env.mysqlpassword munin
Create munin user in MySQL:
CREATE USER 'munin'#'localhost' IDENTIFIED BY 'munin';
GRANT PROCESS, SUPER ON *.* TO 'munin'#'localhost';
GRANT SELECT ON mysql.* TO 'munin'#'localhost';
FLUSH PRIVILEGES;
$ sudo systemctl restart munin-node
The default MySQL plugin shipped with the munin-node installation didn't work for us (with the error mentioned in the original post).
Instead, we found this alternate plugin that worked of us:
https://github.com/kjellm/munin-mysql
As CentOS 7 uses systemd, you'll have to change the line in the Makefile that's $(MUNIN_NODE) restart to systemctl restart munin-node.
Hopefully, this helps others that may encounter the same issue we did.
Bugzilla ./checksetup.pl report:
YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database you use):
SQLite: /usr/bin/perl install-module.pl DBD::SQLite
MySQL: /usr/bin/perl install-module.pl DBD::mysql
PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
Oracle: /usr/bin/perl install-module.pl DBD::Oracle
Here is the output of
$ /usr/bin/perl install-module.pl DBD::mysql
Checking for CPAN (v1.81) ok: found v2.11
Checking for YAML (any) ok: found v1.20
Checking for ExtUtils-MakeMaker (v6.31) ok: found v7.0401
Reading '/root/.cpan/Metadata'
Database was generated on Sat, 10 Dec 2016 15:17:02 GMT
Installing DBD::mysql version 4.041...
Running install for module 'DBD::mysql'
Checksum for /root/.cpan/source/authors/id/M/MI/MICHIELB/DBD-mysql-4.041.tar.gz ok
Configuring M/MI/MICHIELB/DBD-mysql-4.041.tar.gz with Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 88.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem not contain the path to mysql_config. Resorting to guessed values!
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the database
user 'root' can connect to your MySQL server and has the proper
privileges that these tests require such as 'drop table', 'create
table', 'drop procedure', 'create procedure' as well as others.
mysql> grant all privileges on test.* to 'root'#'localhost' identified
by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 561. Can't find mysql_config. Use --mysql_config option to
specify where mysql_config is located Failed to determine directory of
mysql.h. Use
perl Makefile.PL --cflags=-I
to set this directory. For details see DBD::mysql::INSTALL, section "C
Compiler flags" or type
perl Makefile.PL --help Warning: No success on command[/usr/bin/perl
Makefile.PL INSTALLDIRS=site LIB="/var/www/bugzilla/lib"
INSTALLMAN1DIR="/var/www/bugzilla/lib/man/man1"
INSTALLMAN3DIR="/var/www/bugzilla/lib/man/man3"
INSTALLBIN="/var/www/bugzilla/lib/bin"
INSTALLSCRIPT="/var/www/bugzilla/lib/bin" INSTALLDIRS=perl]
MICHIELB/DBD-mysql-4.041.tar.gz /usr/bin/perl Makefile.PL
INSTALLDIRS=site LIB="/var/www/bugzilla/lib"
INSTALLMAN1DIR="/var/www/bugzilla/lib/man/man1"
INSTALLMAN3DIR="/var/www/bugzilla/lib/man/man3"
INSTALLBIN="/var/www/bugzilla/lib/bin"
INSTALLSCRIPT="/var/www/bugzilla/lib/bin" INSTALLDIRS=perl -- NOT OK
When trying
$ /usr/bin/perl install-module.pl DBD::mysql --mysql_config /etc/mysql/mysql.conf.d
This error is reported
There is no Perl module on CPAN named /etc/mysql/mysql.conf.d/usr/bin/perl
Here are the details of the system I am working with
Linux
Ubuntu 16.04.1 LTS
Apache:
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2016-07-14T12:32:26
MySQL:
Ver 14.14 Distrib 5.7.16, for Linux (x86_64) using EditLine wrapper
Perl:
perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-gnu-thread-multi
After reading #Borodin's comment, I issued:
$ sudo apt-get install libdbd-mysql-perl
and the $ ./checksetup.pl --check-modules no longer report any errors.
(Many thanks #Borodin for the hint :-)
I was having the same issue while trying to install bugzilla,
Assumed that you have bugzilla in directory var/www/html
What i did was
Just go to the directory : var/www/html/bugzilla and execute command:
perl install-module.pl --all
If in the end you don't get an automatic installation, try a manual installation.
DBD::mysql manual installation
I'm trying to install JSON::Parse through cpan on an old Debian Etch server. When I do, it fails:
cpan[2]> install JSON::Parse
CPAN: Storable loaded ok (v2.15)
Going to read /root/.cpan/Metadata
Database was generated on Wed, 23 Nov 2016 14:41:02 GMT
Running install for module 'JSON::Parse'
Running make for B/BK/BKB/JSON-Parse-0.48.tar.gz
CPAN: Digest::SHA loaded ok (v5.86)
CPAN: Compress::Zlib loaded ok (v2.068)
Checksum for /root/.cpan/sources/authors/id/B/BK/BKB/JSON-Parse-0.48.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
JSON-Parse-0.48/
JSON-Parse-0.48/unicode.c
JSON-Parse-0.48/examples/
JSON-Parse-0.48/t/
JSON-Parse-0.48/errors.c
JSON-Parse-0.48/lib/
JSON-Parse-0.48/utf8-byte-one.c
JSON-Parse-0.48/json-entry-points.c
JSON-Parse-0.48/json-common.c
JSON-Parse-0.48/json-perl.c
JSON-Parse-0.48/MANIFEST
JSON-Parse-0.48/MANIFEST.SKIP
JSON-Parse-0.48/typemap
JSON-Parse-0.48/utf8-next-byte.c
JSON-Parse-0.48/script/
JSON-Parse-0.48/unicode.h
JSON-Parse-0.48/json-whitespace.c
JSON-Parse-0.48/Json3.xs
JSON-Parse-0.48/Makefile.PL
JSON-Parse-0.48/README
JSON-Parse-0.48/Changes
JSON-Parse-0.48/META.yml
JSON-Parse-0.48/META.json
JSON-Parse-0.48/script/validjson
JSON-Parse-0.48/lib/JSON/
JSON-Parse-0.48/lib/JSON/Tokenize.pod
JSON-Parse-0.48/lib/JSON/Parse.pm
JSON-Parse-0.48/lib/JSON/Tokenize.pm
JSON-Parse-0.48/lib/JSON/Parse.pod
JSON-Parse-0.48/t/collision.t
JSON-Parse-0.48/t/whitespace.t
JSON-Parse-0.48/t/test.json
JSON-Parse-0.48/t/syntax.t
JSON-Parse-0.48/t/valid-json.t
JSON-Parse-0.48/t/numbers.t
JSON-Parse-0.48/t/unicode.t
JSON-Parse-0.48/t/perl-monks-1165399.t
JSON-Parse-0.48/t/array.t
JSON-Parse-0.48/t/syntax-error-1.json
JSON-Parse-0.48/t/kolmorogov42-1.t
JSON-Parse-0.48/t/object.t
JSON-Parse-0.48/t/utf8.t
JSON-Parse-0.48/t/Json3.t
JSON-Parse-0.48/t/test-empty-string.t
JSON-Parse-0.48/t/read-file.t
JSON-Parse-0.48/t/rfc7159.t
JSON-Parse-0.48/t/JSON-Parse.t
JSON-Parse-0.48/examples/assert.pl
JSON-Parse-0.48/examples/sasori.pl
JSON-Parse-0.48/examples/tokenize-synopsis.pl
JSON-Parse-0.48/examples/bad-utf8.pl
JSON-Parse-0.48/examples/kani.pl
JSON-Parse-0.48/examples/true-subs.pl
JSON-Parse-0.48/examples/long-number.pl
JSON-Parse-0.48/examples/synopsis.pl
JSON-Parse-0.48/examples/collide.pl
JSON-Parse-0.48/examples/array.pl
JSON-Parse-0.48/examples/key-collision.pl
JSON-Parse-0.48/examples/first-bit.pl
JSON-Parse-0.48/examples/json-tiny-round-trip-demo.pl
JSON-Parse-0.48/examples/chr.pl
JSON-Parse-0.48/examples/bad-utf8.txt
JSON-Parse-0.48/examples/ebi.pl
JSON-Parse-0.48/examples/hash.pl
CPAN: File::Temp loaded ok (v0.2304)
CPAN: YAML loaded ok (v0.88)
CPAN.pm: Going to build B/BK/BKB/JSON-Parse-0.48.tar.gz
Checking if your kit is complete...
Looks good
Warning: Perl version 5.008009 or higher required. We run 5.008008.
JSON::PP 2.27103 is not available
at /usr/local/share/perl/5.8.8/CPAN/Meta/Converter.pm line 57.
at /usr/local/share/perl/5.8.8/ExtUtils/MM_Any.pm line 831.
Generating a Unix-style Makefile
Writing Makefile for JSON::Parse
Writing MYMETA.yml and MYMETA.json
cp lib/JSON/Parse.pod blib/lib/JSON/Parse.pod
cp lib/JSON/Tokenize.pm blib/lib/JSON/Tokenize.pm
cp lib/JSON/Tokenize.pod blib/lib/JSON/Tokenize.pod
cp lib/JSON/Parse.pm blib/lib/JSON/Parse.pm
Running Mkbootstrap for JSON::Parse ()
chmod 644 Parse.bs
/usr/bin/perl /usr/local/share/perl/5.8.8/ExtUtils/xsubpp -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap typemap Json3.xs
> Json3.xsc && mv Json3.xsc Json3.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.48\" -DXS_VERSION=\"0.48\" -fPIC "-I/usr/lib/perl/5.8/CORE" Json3.c
rm -f blib/arch/auto/JSON/Parse/Parse.so
cc -shared -L/usr/local/lib Json3.o -o blib/arch/auto/JSON/Parse/Parse.so \
\
chmod 755 blib/arch/auto/JSON/Parse/Parse.so
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- Parse.bs blib/arch/auto/JSON/Parse/Parse.bs 644
cp script/validjson blib/script/validjson
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/validjson
Manifying blib/man3/JSON::Parse.3pm
Manifying blib/man3/JSON::Tokenize.3pm
BKB/JSON-Parse-0.48.tar.gz
/usr/bin/make -- OK
Running make test
Running Mkbootstrap for JSON::Parse ()
chmod 644 Parse.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'b
lib/lib', 'blib/arch')" t/*.t
t/array.t ............... ok
t/collision.t ........... ok
t/JSON-Parse.t .......... ok
t/Json3.t ............... ok
t/kolmorogov42-1.t ...... ok
t/numbers.t ............. 1/? Attempt to free unreferenced scalar: SV 0x814ebe0, Perl interpreter: 0x814e008 during global destructi
on.
t/numbers.t ............. ok
t/object.t .............. ok
t/perl-monks-1165399.t .. 1/? Use of uninitialized value in undef operator at t/perl-monks-1165399.t line 38.
t/perl-monks-1165399.t .. ok
t/read-file.t ........... ok
t/rfc7159.t ............. ok
t/syntax.t .............. ok
t/test-empty-string.t ... ok
t/unicode.t ............. ok
t/utf8.t ................ ok
t/valid-json.t .......... All 5 subtests passed
t/whitespace.t .......... ok
Test Summary Report
-------------------
t/valid-json.t (Wstat: 11 Tests: 5 Failed: 0)
Non-zero wait status: 11
Parse errors: No plan found in TAP output
Files=16, Tests=277, 0 wallclock secs ( 0.05 usr 0.01 sys + 0.25 cusr 0.04 csys = 0.35 CPU)
Result: FAIL
Failed 1/16 test programs. 0/277 subtests failed.
make: *** [test_dynamic] Error 255
BKB/JSON-Parse-0.48.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports BKB/JSON-Parse-0.48.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
BKB/JSON-Parse-0.48.tar.gz : make_test NO
Like I said, it's an old Debian Etch server which is running an old version of cpan as well:
# cpan -v
/usr/bin/cpan script version 1.9, CPAN.pm version 1.9205
Can anyone offer any tips?
Your errors include this:
Warning: Perl version 5.008009 or higher required. We run 5.008008.
The current version of JSON::Parse (0.48) requires a more recent version of Perl than the one you have.
This minimum version requirement was added in version 0.25. But looking at the CPAN testers results, it seems that this was just documenting a problem that had been around for some time. You might be able to install version 0.18, but you would be far better advised to upgrade to a version of Debian with a newer version of Perl installed.
If JSON::Parse isn't a dependency for anything you want. You can just use JSON to do the same thing.
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
my $jsonString = "{\"foo\":\"bar\"}";
my $hash = decode_json($jsonString);
print ${$hash}{"foo"} . "\n";
I'm trying to install mysql using:
cpanm DBD::mysql
I got output error like this: Set up gcc environment - 3.4.5 (mingw-vista special r3)
--> Working on DBD::mysql
Fetching http: //www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz ... OK
Configuring DBD-mysql-4.025 ... OK
Building and testing DBD-mysql-4.025 ... FAIL
! Installing DBD::mysql failed. See C:\Users\myuser\cpanm\work\1384776992.9536\build.log for details. Retry with --force to force install it
When I opened the log file to check the detail, it's as bellows. Is there anyone help me out:
cpanm (App::cpanminus) 1.7001 on perl 5.012004 built for MSWin32-x86-multi-thread
Work directory is C:\Users\myuser/.cpanm/work/1384776992.9536
You have make C:\Perl\site\bin\dmake.exe
You have LWP 6.02
Falling back to Archive::Tar 1.76
Searching DBD::mysql on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz
-> OK
Unpacking DBD-mysql-4.025.tar.gz
Entering DBD-mysql-4.025
Checking configure dependencies from META.yml
Checking if you have DBI 1.08 ... Yes (1.616)
Configuring DBD-mysql-4.025
Running Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
mysql_config.pl, and an associated bat file, has been
successfully created under
C:\PROGRA~1\MySQL\MYSQLS~1.1\bin
Unknown option: testdb
Unknown option: testhost
Unknown option: testuser
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to ''#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
Unknown option: testpassword
Unknown option: testsocket
Unknown option: testport
Unknown option: nocatchstderr
Unknown option: ssl
Unknown option: nofoundrows
Unknown option: force-embedded
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include"
embedded (mysql_config) =
ldflags (mysql_config) =
libs (mysql_config) = -LC:\PROGRA~1\MySQL\MYSQLS~1.1\lib\opt -lmysqlclient -lzlib
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if your kit is complete...
Warning: the following files are missing in your kit:
META.json
t/mem_leak.pl
Please inform the author.
Note (probably harmless): No library found for -lmysqlclient
Note (probably harmless): No library found for -lzlib
Using DBI 1.616 (for perl 5.012004 on MSWin32-x86-multi-thread) installed in C:/Perl/lib/auto/DBI/
Writing Makefile for DBD::mysql
-> OK
Finding PREREQ from Makefile ...
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have Data::Dumper 0 ... Yes (2.128)
Checking if you have Test::Deep 0 ... Yes (0.110)
Checking if you have DBI 1.08 ... Yes (1.616)
Building and testing DBD-mysql-4.025
cp lib/DBD/mysql.pm blib\lib\DBD\mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib\lib\DBD\mysql\GetInfo.pm
cp README.pod blib\lib\DBD\README.pod
cp lib/DBD/mysql/INSTALL.pod blib\lib\DBD\mysql\INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib\lib\Bundle\DBD\mysql.pm
C:/Perl/site/bin/gcc.exe -c -IC:\Perl\lib\auto\DBI -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include" - DDBD_MYSQL_INSERT_ID_IS_GOOD -g -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"4.025\" -DXS_VERSION=\"4.025\" "-IC:\Perl\lib\CORE" dbdimp.c
In file included from dbdimp.c:18:
dbdimp.h:21:49: mysql.h: No such file or directory
dbdimp.h:22:45: mysqld_error.h: No such file or directory
dbdimp.h:24:49: errmsg.h: No such file or directory
In file included from dbdimp.c:18:
dbdimp.h:157: error: syntax error before "MYSQL"
dbdimp.h:157: warning: no semicolon at end of struct or union
dbdimp.h:180: error: syntax error before '}' token
dbdimp.h:255: error: syntax error before "MYSQL_RES"
dbdimp.h:255: warning: no semicolon at end of struct or union
dbdimp.h:258: error: syntax error before "row_num"
dbdimp.h:258: warning: data definition has no type or storage class
dbdimp.h:263: error: syntax error before "insertid"
dbdimp.h:263: warning: data definition has no type or storage class
dbdimp.h:267: error: conflicting types for 'use_mysql_use_result'
dbdimp.h:165: error: previous declaration of 'use_mysql_use_result' was here
dbdimp.h:274: error: syntax error before '}' token
...............................................
-> FAIL Installing DBD::mysql failed. See C:\Users\wangw35\.cpanm\work\1384776992.9536\build.log for details. Retry with --force to force install it.
These are the two important lines.
Note (probably harmless): No library found for -lmysqlclient
Note (probably harmless): No library found for -lzlib
You need to install the mysqlclient (and also zlib) on your system.