Unable to install Mysql

I am unable to install Mysql in cpan shell.

I constantly get the error:

Non-zero exit status: 10 Parse errors: Bad plan. You planned 9 tests but ran 1. t/20createdrop.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 5 tests but ran 1. t/30insertfetch.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 11 tests but ran 1. t/35limit.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 113 tests but ran 1. t/35prepare.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 30 tests but ran 0. t/40bindparam.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 28 tests but ran 1. t/40bindparam2.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 13 tests but ran 1. t/40blobs.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 11 tests but ran 1. t/40listfields.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 18 tests but ran 1. t/40nulls.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 11 tests but ran 1. t/40numrows.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 25 tests but ran 1. t/41bindparam.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 11 tests but ran 0. t/41blobs_prepare.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 24 tests but ran 1. t/42bindparam.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 11 tests but ran 0. t/50chopblanks.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 35 tests but ran 1. t/50commit.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255 Parse errors: Bad plan. You planned 30 tests but ran 1. t/dbdadmin.t (Wstat: 2560 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 10 Parse errors: Bad plan. You planned 21 tests but ran 1. t/insertid.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 12 tests but ran 0. t/param_values.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255 Parse errors: Bad plan. You planned 8 tests but ran 1. t/prepare_noerror.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/texecute.t (Wstat: 65280 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 255 Parse errors: Bad plan. You planned 9 tests but ran 1. Files=23, Tests=21, 7 wallclock secs ( 0.08 usr 0.10 sys + 1.19 cusr 0.15 csys = 1.52 CPU) Result: FAIL Failed 21/23 test programs. 16/21 subtests failed. make: *** [test_dynamic] Error 255 CAPTTOFU/DBD-mysql-3.0008.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports CAPTTOFU/DBD-mysql-3.0008.tar.gz Running make install make test had returned bad status, won't install without force Failed during this command: CAPTTOFU/DBD-mysql-3.0008.tar.gz : make_test NO

                                                                            cpan[2]> install Test::Harness

Test::Harness is up to date (3.21).

                                                                            cpan[3]> install Mysql > /root/install.Mysql.error

DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/10dsnlist.t line 45 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/20createdrop.t line 45 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/30insertfetch.t line 48 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/35limit.t line 50 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/35prepare.t line 37 DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40bindparam.t line 64 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40bindparam2.t line 64 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40blobs.t line 64 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40listfields.t line 57 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40nulls.t line 50 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/40numrows.t line 59 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/41bindparam.t line 37 DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/41blobs_prepare.t line 71 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/42bindparam.t line 37 DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/50chopblanks.t line 57 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/50commit.t line 64 Can't call method "tables" on an undefined value at t/lib.pl line 232. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/dbdadmin.t line 74 Cannot connect: Access denied for user 'root'@'localhost' (using password: NO) Either your server is not up and running or you have no permissions for acessing the DSN DBI:mysql:test. This test requires a running server and write permissions. Please make sure your server is running and you have permissions, then retry. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/insertid.t line 13 DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/param_values.t line 16 Can't call method "tables" on an undefined value at t/lib.pl line 232. DBI connect('test;mysql_server_prepare=1','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/prepare_noerror.t line 22 Can't call method "prepare" on an undefined value at t/prepare_noerror.t line 25. DBI connect('test','',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at t/texecute.t line 17 Can't call method "tables" on an undefined value at t/lib.pl line 232. Failed 21/23 test programs. 16/21 subtests failed. make: *** [test_dynamic] Error 255 Failed during this command:

The output from command CPAN> install Mysql > install.Mysql.error.txt is on this link:

http://ahostz.com/install.Mysql.error.txt.

Status: 
Active

Comments

bislinks's picture
Submitted by bislinks on Thu, 07/29/2010 - 10:01 Pro Licensee

I also granted full access on database test to root

i dont know what else to do

Howdy -- one option rather than installing directly from CPAN is to use the CentOS package for Perl's DBD::MySQL.

If you're interested in going that route, you can install it by installing the CentOS package named "perl-DBD-MySQL".

One way to do that is to log into your server as root over SSH, and run this from the command line:

yum install perl-DBD-MySQL

bislinks's picture
Submitted by bislinks on Thu, 07/29/2010 - 10:48 Pro Licensee

output of command: perl DBD::MySQL :-

Package perl-DBD-MySQL is obsoleted by perl-DBD-mysql, trying to install perl-DBD-mysql-4.014-1.el5.rf.i386 instead

Package perl-DBD-mysql-4.014-1.el5.rf.i386 already installed and latest version

But, i still get this error for use Mysql in script:- ahostz.com/d/db/users.show.pl

Can't locate object method "connect" via package "Mysql" (perhaps you forgot to load "Mysql"?) at users.show.pl line 11.

The issue could actually be a problem with the app you're using -- I'd expect to see that particular error if the app wasn't attempting to load the Perl MySQL module for some reason.

If the app attempted to load the Perl MySQL module, but wasn't able to, the error message would say something about "Unable to load Mysql".

I'd make sure your app is configured to use MySQL, and is setup to load the MySQL module.

To verify that Perl is able to find the MySQL module, you can try running this code from the command line on your server:

perl -MDBD::mysql -e 'print $DBD::mysql::VERSION, "\n"'

The output should be the version number of the MySQL module.

bislinks's picture
Submitted by bislinks on Thu, 07/29/2010 - 13:29 Pro Licensee

The output of the above command is : 4.016

HERE IS MY ACTUAL CODE

!/usr/bin/perl

use strict; use CGI; my $q=new CGI; print $q->header; use CGI::Carp qw/fatalsToBrowser/;

use Mysql;

use vars qw /......./;

require "users.config.pl";

$connect = Mysql->connect($host, $database, $user, $pw); $myquery = qq~SELECT * FROM $tablename~; $execute = $connect->query($myquery);

@r = $execute->fetchrow();

....

END OF users.show.pl

CODE FOR users.config.pl:

!/usr/bin/perl

use strict; use CGI; my $q=new CGI; #print $q->header; use CGI::Carp qw/fatalsToBrowser/;

use vars qw / $host $database $tablename $user $pw /;

MySQL CONFIG VARIABLES

$host = "localhost"; $database = "..."; $tablename = "..."; $user = ".."; $pw = "....j";

Okay, it took a bit of digging to figure this all out :-)

It seems the script you're using has code only available in the 3.x version of the DBD::MySQL module, whose last release was way back in 2006.

My suggestion would be to update the database related code in your Perl script, to use the newer DBD::MySQL syntax.

The 3.x branch of DBD::MySQL is no longer being maintained, and the errors you're getting during installation suggest that there's a number of problems preventing it from working properly even if you were able to get it installed.