Skip to content

Commit b9c3ee3

Browse files
jb-boingrooverdan
authored andcommitted
MDEV-37852 mytop: fix connection to localhost
If a port is specified and DBD-MariaDB is used. This resulted in in: ("Connection error: port cannot be specified when host is localhost or embedded") Fixes Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1109394
1 parent 9220be8 commit b9c3ee3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/mytop.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# $Id: mytop,v 1.99-maria6 2019/10/22 14:53:51 jweisbuch Exp $
3+
# $Id: mytop,v 1.99-maria8 2025/07/16 17:59:26 jweisbuch Exp $
44

55
=pod
66
@@ -21,7 +21,7 @@ use Socket;
2121
use List::Util qw(min max);
2222
use File::Basename;
2323

24-
$main::VERSION = "1.99-maria6";
24+
$main::VERSION = "1.99-maria8";
2525
my $path_for_script = dirname($0);
2626

2727
$| = 1;
@@ -256,7 +256,11 @@ if (eval {DBI->install_driver("MariaDB")}) {
256256

257257
if ($config{socket} and -S $config{socket})
258258
{
259-
$dsn .= "${prefix}_socket=$config{socket}";
259+
$dsn .= "${prefix}_socket=$config{socket}";
260+
}
261+
elsif($config{host} eq "localhost")
262+
{
263+
$dsn .= "host=$config{host}";
260264
}
261265
else
262266
{

0 commit comments

Comments
 (0)