Permalink
Browse files

List users without passwords as user@host, sorted.

  • Loading branch information...
1 parent b2dfc87 commit 0bd59c33304ebd518d36431bb70c0858c15edd02 @scop scop committed Dec 24, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 mysqltuner.pl
View
@@ -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";
}

0 comments on commit 0bd59c3

Please sign in to comment.