Skip to content

Commit

Permalink
use the maintanance account on debian system
Browse files Browse the repository at this point in the history
  • Loading branch information
koebi001 committed Apr 20, 2011
1 parent 6add618 commit 18bab70
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mysqltuner.pl
Expand Up @@ -292,6 +292,14 @@ sub mysql_setup {
badprint "Attempted to use login credentials from Plesk, but they failed.\n";
exit 0;
}
} elsif ( -r "/etc/mysql/debian.cnf" and $doremote == 0 ){
# It's a debian system, use the maintenance account
$mysqllogin = "-u `awk '\$1 ~ /user/ {print \$3}' /etc/mysql/debian.cnf | head -n 1` -p`awk '\$1 ~ /password/ {print \$3}' /etc/mysql/debian.cnf | head -n 1`";
my $loginstatus = `mysqladmin ping $mysqllogin 2>&1`;
unless ($loginstatus =~ /mysqld is alive/) {
badprint "Attempted to use login credentials from debian maintenance account, but they failed.\n";
exit 0;
}
} else {
# It's not Plesk, we should try a login
my $loginstatus = `mysqladmin $remotestring ping 2>&1`;
Expand Down

0 comments on commit 18bab70

Please sign in to comment.