From b42b97f96f53870abb6fba3d4fd8efbef73b313d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Aug 2016 17:40:53 +0200 Subject: [PATCH] #227 Stopping MySQL tuner when SELECT VERSION doesnt return any value. This indicates that user doent get enough privileges --- mysqltuner.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysqltuner.pl b/mysqltuner.pl index c08e91c..9655788 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -945,6 +945,10 @@ sub arr2hash { sub get_all_vars { # We need to initiate at least one query so that our data is useable $dummyselect = select_one "SELECT VERSION()"; + if (not defined($dummyselect) or $dummyselect== "") { + badprint "You probably doesn't get enough privileges for running MySQLTuner ..." + exit(256); + } $dummyselect =~ s/(.*?)\-.*/$1/; debugprint "VERSION: " . $dummyselect . ""; $result{'MySQL Client'}{'Version'} = $dummyselect;