smeserver-mysql/root/etc/e-smith/templates/var/lib/mysql/set.password

13 lines
387 B
Plaintext

{
use esmith::util;
my $pw = esmith::util::LdapPassword();
$OUT .= "use mysql;\n";
$OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
$OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n";
$OUT .= "DELETE FROM db WHERE user='';\n";
$OUT .= "DELETE FROM user WHERE user='';\n";
$OUT .= "FLUSH PRIVILEGES;\n";
}