From be1f4b48c45aaf759ff0e115a33ee7d4f29cb106 Mon Sep 17 00:00:00 2001 From: i5513 Date: Tue, 20 Dec 2016 10:35:41 +0100 Subject: [PATCH] Allow to connect via socket with not default port Seems like it is necessary to specify the port when you have 2 instances runing and you want to connect via socket. --- mysqltuner.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 5631e7b..abb71ed 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -685,15 +685,15 @@ sub mysql_setup { debugprint "MySQL Client: $mysqlcmd"; + $opt{port} = ( $opt{port} eq 0 ) ? 3306 : $opt{port}; # Are we being asked to connect via a socket? if ( $opt{socket} ne 0 ) { - $remotestring = " -S $opt{socket}"; + $remotestring = " -S $opt{socket} -P $opt{port}"; } # Are we being asked to connect to a remote server? if ( $opt{host} ne 0 ) { chomp( $opt{host} ); - $opt{port} = ( $opt{port} eq 0 ) ? 3306 : $opt{port}; # If we're doing a remote connection, but forcemem wasn't specified, we need to exit if ( $opt{'forcemem'} eq 0