Skip to content

Conversation

@jmrenouard
Copy link
Collaborator

This commit introduces a generic framework for connecting to cloud-based MySQL services, with an initial focus on Azure. It adds new command-line options to facilitate both direct and SSH-proxied connections.

The implementation includes:

  • A generic cloud mode activated by the --cloud flag.
  • Azure-specific support via the --azure flag, which now acts as an alias for --cloud.
  • SSH connection options: --ssh-host, --ssh-user, --ssh-password, and --ssh-identity-file.
  • A unified execute_system_command function to handle both local and remote command execution with proper error handling.
  • Updated documentation in the README.md to reflect the new features, with translations in French, Italian, and Russian.

This commit introduces a generic framework for connecting to cloud-based MySQL services, with an initial focus on Azure. It adds new command-line options to facilitate both direct and SSH-proxied connections.

The implementation includes:
- A generic cloud mode activated by the `--cloud` flag.
- Azure-specific support via the `--azure` flag, which now acts as an alias for `--cloud`.
- SSH connection options: `--ssh-host`, `--ssh-user`, `--ssh-password`, and `--ssh-identity-file`.
- A unified `execute_system_command` function to handle both local and remote command execution with proper error handling.
- Updated documentation in the `README.md` to reflect the new features, with translations in French, Italian, and Russian.
@jmrenouard jmrenouard self-assigned this Nov 11, 2025
@jmrenouard jmrenouard requested a review from Copilot November 11, 2025 00:56
Copilot finished reviewing on behalf of jmrenouard November 11, 2025 00:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a generic cloud support framework for MySQLTuner, enabling connections to cloud-based MySQL services through SSH tunneling or direct connections. The implementation focuses on Azure support as the initial cloud provider.

Key changes:

  • New cloud mode infrastructure with --cloud and --azure flags for enabling cloud connectivity
  • SSH connection options (--ssh-host, --ssh-user, --ssh-password, --ssh-identity-file) for remote command execution
  • Unified execute_system_command function that wraps all system calls to support both local and SSH-proxied execution

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
mysqltuner.pl Adds cloud mode support with new command-line options, SSH infrastructure, and unified system command execution wrapper
README.md Documents the new cloud support features with translations in English, French, Italian, and Russian

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$mysqladmincmd = $ssh_prefix . $mysqladmincmd;
$mysqlcmd = $ssh_prefix . $mysqlcmd;
$mysqlcmd =~ s/\n$//g;
my $mysqlclidefaults = `$mysqlcmd --print-defaults`;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backtick command execution should be replaced with execute_system_command for consistency with the rest of the changes and to properly support SSH-based cloud connections. Use: my $mysqlclidefaults = execute_system_command("$mysqlcmd --print-defaults");

Suggested change
my $mysqlclidefaults = `$mysqlcmd --print-defaults`;
my $mysqlclidefaults = execute_system_command("$mysqlcmd --print-defaults");

Copilot uses AI. Check for mistakes.
if ($opt{'ssh-identity-file'} ne '') {
$ssh_base_cmd .= " -i '" . $opt{'ssh-identity-file'} . "'";
}
$ssh_base_cmd .= " -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null'";
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling StrictHostKeyChecking and using /dev/null for UserKnownHostsFile makes connections vulnerable to man-in-the-middle attacks. Consider documenting this security risk or providing an option for users to enable strict host key checking.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <[email protected]>
@jmrenouard jmrenouard merged commit 445c78a into major:master Nov 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant