Skip to content

Conversation

Copy link

Copilot AI commented Dec 22, 2025

When --user is specified without --pass, the script attempts passwordless authentication and exits on failure. This prevents interactive password entry for users who want to avoid exposing credentials in command history.

Changes

  • Add password prompt when --user is provided, --pass is not, and initial connection fails
  • Prompt only occurs if --noask flag is not set (preserves automation behavior)
  • Use stty -echo for secure password input, matching existing prompt implementation
  • Consolidate duplicate error handling

Example

Before:

$ perl mysqltuner.pl --user dbadmin
[!!] Attempted to use login credentials, but they were invalid
$ _

After:

$ perl mysqltuner.pl --user dbadmin
Please enter your MySQL administrative password: ********
[OK] Logged in using credentials with prompted password
[--] Performing tests on localhost:3306

All existing authentication flows remain unchanged:

  • --user + --pass → uses provided credentials
  • --user + --noask → exits on failure without prompting
  • No credentials → tries auto-detection, then prompts for both username and password
Original prompt

This section details on the original issue you should resolve

<issue_title>Prompt for username and password by default</issue_title>
<issue_description>Hi,

Congratulations for this excellent product.

It would be nice if MySQLTuner-perl prompted for username and password if not specified in the parameters/arguments passed on execution.

--
Regards,
Mauro</issue_description>

<agent_instructions>read le README.md and anwser</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 22, 2025 07:49
Co-authored-by: jmrenouard <620907+jmrenouard@users.noreply.github.com>
Co-authored-by: jmrenouard <620907+jmrenouard@users.noreply.github.com>
Copilot AI changed the title [WIP] Add default prompt for username and password in MySQLTuner-perl Prompt for password when --user provided without --pass Dec 22, 2025
Copilot AI requested a review from jmrenouard December 22, 2025 07:54
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.

Prompt for username and password by default

2 participants