summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 09:22:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-31 09:22:21 +0300
commit04647611260a77041186ace12f96b05d50bed4da (patch)
tree3f8efa00ae2fa2bc6be5165658c34c79c9437a3f /scripts
parentdc6bc85cd29586631d927036451d955c7013206c (diff)
parente835cc851e389770219a33037af65db8887cc9a8 (diff)
downloadmariadb-git-04647611260a77041186ace12f96b05d50bed4da.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_setpermission.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index 71462d28622..7c0ef575db7 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -52,6 +52,7 @@ use strict;
use vars qw($dbh $sth $hostname $opt_user $opt_password $opt_help $opt_host
$opt_socket $opt_port $host $version);
+my $sqlport = "";
my $sqlhost = "";
my $user = "";
@@ -84,9 +85,13 @@ if ($opt_password eq '')
print "\n";
}
+# Using port argument with 'localhost' will cause an error
+if ($sqlhost ne "localhost") {
+ $sqlport = ":port=$opt_port";
+}
# make the connection to MariaDB
-$dbh= DBI->connect("DBI:mysql:mysql:host=$sqlhost:port=$opt_port:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) ||
+$dbh= DBI->connect("DBI:mysql:mysql:host=$sqlhost$sqlport:mysql_socket=$opt_socket",$opt_user,$opt_password, {PrintError => 0}) ||
die("Can't make a connection to the mysql server.\n The error: $DBI::errstr");
# the start of the program
@@ -278,7 +283,6 @@ sub addall {
$sth = $dbh->do("REVOKE ALL ON $db.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr;
}
}
- $dbh->do("FLUSH PRIVILEGES") || print STDERR "Can't flush privileges\n";
print "Everything is inserted and mysql privileges have been reloaded.\n\n";
}