major / MySQLTuner-perl

MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.
GNU General Public License v3.0
8.94k stars 1.29k forks source link

Fails when there is no which command #185

Closed php-coder closed 8 years ago

php-coder commented 8 years ago
$ perl mysqltuner.pl                   
 >>  MySQLTuner 1.6.9 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >>  Run with '--help' for additional options and output filtering
Can't exec "which": No such file or directory at mysqltuner.pl line 615 (#1)
    (W exec) A system(), exec(), or piped open call could not execute the
    named program for the indicated reason.  Typical reasons include: the
    permissions were wrong on the file, the file wasn't found in
    $ENV{PATH}, the executable in question was compiled for another
    architecture, or the #! line in a script points to an interpreter that
    can't be run for similar reasons.  (Or maybe your system doesn't support
    #! at all.)

Use of uninitialized value $mysqladmincmd in scalar chomp at mysqltuner.pl line
    617 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    anid the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.

Use of uninitialized value $mysqladmincmd in -e at mysqltuner.pl line 618 (#1)
Use of uninitialized value $mysqladmincmd in -e at mysqltuner.pl line 623 (#1)
[!!] Couldn't find mysqladmin in your $PATH. Is MySQL installed?

It's because there is no which command in CentOS:

$ which mysqladmin
bash: which: command not found
$ type mysqladmin    
mysqladmin is /opt/rh/mysql55/root/usr/bin/mysqladmin
$ whereis mysqladmin
mysqladmin: /opt/rh/mysql55/root/usr/bin/mysqladmin
$ cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core)
jmrenouard commented 8 years ago

Hi @php-coder

Can you tell me if last PR solved this issue ?

@mrqwer88 send us a patch for which issues.

Thanks for your help !

jmrenouard commented 8 years ago

@php-coder

I think PR is https://github.com/major/MySQLTuner-perl/pull/191

php-coder commented 8 years ago

Yes, it's fixed.