Permalink
Browse files

List users without passwords as user@host, sorted.

  • Loading branch information...
1 parent b2dfc87 commit e8495cea281534f8233d8e64f721f633f7e8efdb @scop scop committed with 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 e8495ce

Please sign in to comment.