#227 Stopping MySQL tuner when SELECT VERSION doesnt return any value. This indicates that user doent get enough privileges

This commit is contained in:
root 2016-08-08 17:40:53 +02:00
parent e8e608b471
commit b42b97f96f

View file

@ -945,6 +945,10 @@ sub arr2hash {
sub get_all_vars { sub get_all_vars {
# We need to initiate at least one query so that our data is useable # We need to initiate at least one query so that our data is useable
$dummyselect = select_one "SELECT VERSION()"; $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/; $dummyselect =~ s/(.*?)\-.*/$1/;
debugprint "VERSION: " . $dummyselect . ""; debugprint "VERSION: " . $dummyselect . "";
$result{'MySQL Client'}{'Version'} = $dummyselect; $result{'MySQL Client'}{'Version'} = $dummyselect;