Skip to content

Commit

Permalink
Please add support for --protocol=TCP #474
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrenouard committed Feb 7, 2022
1 parent e437c1a commit c5cc409
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# mysqltuner.pl - Version 1.9.3
# mysqltuner.pl - Version 1.9.4
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2022 Major Hayden - major@mhtx.net
#
Expand Down Expand Up @@ -56,7 +56,7 @@ package main;
#use Env;

# Set up a few variables for use in the script
my $tunerversion = "1.9.3";
my $tunerversion = "1.9.4";
my ( @adjvars, @generalrec );

# Set defaults
Expand Down Expand Up @@ -107,6 +107,7 @@ package main;
"reportfile" => 0,
"verbose" => 0,
"defaults-file" => '',
"protocol" => '',
);

# Gather the options from the command line
Expand Down Expand Up @@ -137,7 +138,7 @@ package main;
'sysstat', 'nosysstat',
'pfstat', 'nopfstat',
'idxstat', 'noidxstat',
'server-log=s',
'server-log=s', 'protocol=s',
)
or pod2usage(
-exitval => 1,
Expand Down Expand Up @@ -741,6 +742,10 @@ sub mysql_setup {
$remotestring = " -S $opt{socket} -P $opt{port}";
}

if ( $opt{protocol} ne '' ){
$remotestring = " --protocol=$opt{protocol}";
}

# Are we being asked to connect to a remote server?
if ( $opt{host} ne 0 ) {
chomp( $opt{host} );
Expand Down Expand Up @@ -2188,8 +2193,8 @@ sub validate_mysql_version {
badprint "Your MySQL version "
. $myvar{'version'}
. " is EOL software! Upgrade soon!";
push ( @recommendations, "You are using n unsupported version for production environments");
push ( @recommendations, "Upgrade as soon as possible to a supported version !");
push ( @generalrec, "You are using n unsupported version for production environments");
push ( @generalrec, "Upgrade as soon as possible to a supported version !");

}
}
Expand Down Expand Up @@ -6850,7 +6855,7 @@ sub which {
=head1 NAME
MySQLTuner 1.9.3 - MySQL High Performance Tuning Script
MySQLTuner 1.9.4 - MySQL High Performance Tuning Script
=head1 IMPORTANT USAGE GUIDELINES
Expand All @@ -6864,6 +6869,7 @@ =head1 CONNECTION AND AUTHENTICATION
--host <hostname> Connect to a remote host to perform tests (default: localhost)
--socket <socket> Use a different socket for a local connection
--port <port> Port to use for connection (default: 3306)
--protocol tcp Force TCP connection instead of socket
--user <username> Username to use for authentication
--userenv <envvar> Name of env variable which contains username to use for authentication
--pass <password> Password to use for authentication
Expand Down

0 comments on commit c5cc409

Please sign in to comment.