aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-01-23 12:40:29 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-01-23 12:40:29 +0200
commitbb9f85ecb5f9d36b250ec1c84e44298b25e6632f (patch)
tree2016c6342083c30cb96682b5039aeef7be8d1dfb
parent70a86be6c01f123cb166715ee03c21a5a5ded34b (diff)
downloadmysqlstat-bb9f85ecb5f9d36b250ec1c84e44298b25e6632f.tar.gz
mysqlstat-bb9f85ecb5f9d36b250ec1c84e44298b25e6632f.tar.bz2
Minor fixes in mysqlstat-setup
-rw-r--r--setup/mysqlstat-setup.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/setup/mysqlstat-setup.pl b/setup/mysqlstat-setup.pl
index 6c8eecc..6366e33 100644
--- a/setup/mysqlstat-setup.pl
+++ b/setup/mysqlstat-setup.pl
@@ -263,15 +263,17 @@ sub db_modify {
my $dbd = shift;
my $q = shift;
my $sth = $dbd->prepare($q);
- my $res = $sth->execute(@_) or croak($sth->errstr);
+ my $res = $sth->execute(@_) or die($sth->errstr);
$sth->finish;
return $res;
}
sub sql_create_user {
my $dbd = db_connect();
- my $q = q{GRANT PROCESS, REPLICATION CLIENT ON *.* TO ?@?};
my @args = ($snmp_user, $snmp_host);
+ db_modify($dbd, q{CREATE USER IF NOT EXISTS ?@?}, @args);
+
+ my $q = q{GRANT PROCESS, REPLICATION CLIENT ON *.* TO ?@?};
if ($snmp_password) {
push @args, $snmp_password;
$q .= ' IDENTIFIED BY ?';

Return to:

Send suggestions and report system problems to the System administrator.