From e8495cea281534f8233d8e64f721f633f7e8efdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 25 Dec 2009 05:24:23 +0800 Subject: [PATCH] List users without passwords as user@host, sorted. --- mysqltuner.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 55013aa..7ab2ec1 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -358,9 +358,9 @@ sub get_all_vars { sub security_recommendations { print "\n-------- Security Recommendations -------------------------------------------\n"; - my @mysqlstatlist = `mysql $mysqllogin -Bse "SELECT user FROM mysql.user WHERE password = '' OR password IS NULL;"`; + my @mysqlstatlist = `mysql $mysqllogin -Bse "SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE password = '' OR password IS NULL;"`; if (@mysqlstatlist) { - foreach my $line (@mysqlstatlist) { + foreach my $line (sort @mysqlstatlist) { chomp($line); badprint "User '".$line."' has no password set.\n"; }