diff options
-rw-r--r-- | scripts/mysql_setpermission.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 29311b9c101..6f0ad72c1d9 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -105,11 +105,15 @@ else { if ($opt_socket and -S $opt_socket) { - $dsn .= "${prefix}_socket=$opt_socket"; + $dsn .= "${prefix}_socket=$opt_socket"; } else { - $dsn .= "host=$sqlhost;port=$opt_port"; + $dsn .= "host=$sqlhost"; + if ($sqlhost ne "localhost") + { + $dsn .= ";port=$opt_port"; + } } # make the connection to MariaDB |