NAME
August 19, 2026 ยท View on GitHub
MySQLTuner 2.9.2 - MySQL High Performance Tuning Advisor for MySQL, MariaDB, and Percona Server
SYNOPSIS
mysqltuner [OPTIONS]
# Basic local execution using standard unix socket
perl mysqltuner.pl
# Remote TCP/IP connection with explicit credentials and forced memory sizing
perl mysqltuner.pl --host 192.168.1.50 --port 3306 --user root --pass secret --forcemem 16G
# Containerized database analysis via Docker/Podman
perl mysqltuner.pl --container production_mysql_1 --user root --pass secret
# Generate comprehensive interactive HTML diagnostic dashboard
perl mysqltuner.pl --reportfile /var/www/html/tuner_report.html
# Export schema markdown documentation per database
perl mysqltuner.pl --schemadir /opt/db_docs/
# AI Agent integration output (actionable JSON remediation plan)
perl mysqltuner.pl --agent-json
IMPORTANT USAGE GUIDELINES
- Production Stability: Run the script without modifying arguments first to review recommendations before applying changes.
- Representative Workload: Allow your database server to run under normal production load for at least 24 to 48 hours before trusting metric ratios and sizing advice.
- Privilege Requirements: Administrative read-only access (
SELECT,PROCESS,SHOW DATABASES,REPLICATION CLIENT) is required for exhaustive diagnostics. - Remote Host Hardware Sizing: When connecting over TCP/IP or SSH to remote instances, specify host RAM via
--forcemem(e.g.,--forcemem 32G) to ensure accurate buffer sizing recommendations.
OPTIONS
Connection and Authentication Options
-
--host hostname
Connect to remote MySQL/MariaDB server via TCP/IP hostname or IP address.
-
--port port
TCP/IP port number to connect to (default: 3306).
-
--socket socket_path
Path to local UNIX domain socket for database communication.
-
--user username
Database username for authentication.
-
--password password, --pass password
Database password for authentication.
-
--ask-pass
Prompt interactively for database password on the terminal.
-
--defaults-file path
Path to a custom MySQL configuration file (e.g.,
~/.my.cnf). -
--defaults-extra-file path
Path to an additional configuration file to read after standard defaults.
-
--login-path path
Read credentials from MySQL encrypted login path (via
mysql_config_editor). -
--mysqlcmd path
Path to custom
mysqlclient binary. -
--mysqladmin path
Path to custom
mysqladminbinary. -
--tli
Use Transport Layer Interface abstraction.
-
--ssl-ca path
Path to SSL Certificate Authority (CA) certificate.
-
--caching-sha2-password
Force caching_sha2_password authentication plugin mode.
Target Environment and Cloud Discovery Options
-
--container container_name_or_id
Execute diagnostics inside a running Docker or Podman container.
-
--ssh-host hostname
Execute diagnostics over SSH remote transport.
-
--ssh-user username
SSH login username.
-
--ssh-key path
Path to SSH private key file.
-
--ssh-port port
SSH daemon port (default: 22).
-
--aws-profile profile
AWS CLI profile for Amazon RDS / Aurora cluster discovery.
-
--aws-region region
AWS Region for RDS / Aurora discovery.
-
--aws-cluster-identifier id
Amazon RDS / Aurora cluster identifier.
-
--aws-instance-identifier id
Amazon RDS instance identifier.
-
--gcp-project project_id
Google Cloud project ID for Cloud SQL instances.
-
--gcp-instance instance_id
Google Cloud SQL instance identifier.
-
--azure-resource-group group
Azure resource group for Azure Database for MySQL.
-
--azure-server-name name
Azure MySQL flexible/single server name.
Performance and Diagnostic Tuning Options
-
--forcemem size
Amount of physical RAM installed in host (e.g.,
16G,1024M,128K). -
--forceswap size
Amount of configured swap space on host (e.g.,
4G,2048M). -
--skipworkload
Bypass high-cardinality table churn and auto-increment exhaustion checks.
-
--skippassword
Skip offline dictionary checks for weak user passwords.
-
--skipsize
Skip table size enumeration queries on
information_schema. -
--buffers
Print detailed per-buffer memory allocations.
-
--cvefile path
Path to custom CVE vulnerabilities CSV database file.
-
--passwordfile path
Path to custom dictionary file for password audits.
-
--checkversion
Check for upstream MySQLTuner version updates.
-
--nondedicated
Adjust tuning formulas assuming the host runs non-database workloads.
-
--noprocess
Skip OS-level non-mysqld process enumeration.
Output and Export Options
-
--verbose, -v
Activate full verbose output including storage engines and table statistics.
-
--silent
Suppress standard console output.
-
--outputfile path
Save console report to plain text file.
-
--reportfile [path]
Generate interactive self-contained HTML diagnostic dashboard.
-
--json
Output raw diagnostic results as a JSON string.
-
--prettyjson
Output diagnostic results as formatted, indented JSON.
-
--agent-json
Output actionable AI remediation schema with SQL/config fixes and rollback statements.
-
--yaml
Output diagnostic metrics in YAML format.
-
--dumpdir path
Dump diagnostic data files and Markdown schema summaries to target directory.
-
--schemadir path
Export individual Markdown documentation files with Mermaid ER diagrams per schema.
-
--nocolor
Disable ANSI color codes in terminal output.
-
--noprettyicon
Use plain text markers ([OK], [!!], [--]) instead of Unicode icons.
-
--stage-timings
Display execution duration for each analysis stage.
Debugging and Filtering Options
-
--debug
Print internal debug traces and SQL query payloads.
-
--dbgpattern regex
Filter debug messages by regular expression pattern.
-
--nobad
Suppress negative findings and warning recommendations.
-
--nogood
Suppress positive / passing health checks.
-
--noinfo
Suppress informational messages.
VERSION
Version 2.9.2
PERLDOC
You can inspect the embedded manual with the perldoc command:
perldoc mysqltuner.pl
INTERNALS
https://github.com/jmrenouard/MySQLTuner-perl/blob/master/INTERNALS.md
Internal documentation
AUTHORS
Major Hayden - major@mhtx.net Jean-Marie Renouard - jmrenouard@gmail.com
CONTRIBUTORS
- Matthew Montgomery
- Paul Kehrer
- Dave Burgess
- Jonathan Hinds
- Mike Jackson
- Nils Breunese
- Shawn Ashlee
- Luuk Vosslamber
- Ville Skytta
- Trent Hornibrook
- Jason Gill
- Mark Imbriaco
- Greg Eden
- Aubin Galinotti
- Giovanni Bechis
- Bill Bradford
- Ryan Novosielski
- Michael Scheidell
- Blair Christensen
- Hans du Plooy
- Victor Trac
- Everett Barnes
- Tom Krouper
- Gary Barrueto
- Simon Greenaway
- Adam Stein
- Isart Montane
- Baptiste M.
- Cole Turner
- Daniel Lewart
- Jason Gill
- Jean-Marie Renouard
- Major Hayden
- Matthew Montgomery
- Stephan GroBberndt
- Christian Loos
- Long Radix
- derZ-dev
SUPPORT
Bug reports, feature requests, and downloads at http://mysqltuner.pl/
Bug tracker can be found at https://github.com/jmrenouard/MySQLTuner-perl/issues
Maintained by Jean-Marie Renouard (jmrenouard\@gmail.com) - Licensed under GPL
SOURCE CODE
https://github.com/jmrenouard/MySQLTuner-perl/
git clone https://github.com/jmrenouard/MySQLTuner-perl/.git
COPYRIGHT AND LICENSE
Copyright (C) 2006-2026 Major Hayden - major@mhtx.net # Copyright (C) 2015-2026 Jean-Marie Renouard - jmrenouard@gmail.com
For the latest updates, please visit http://mysqltuner.pl/
Git repository available at https://github.com/jmrenouard/MySQLTuner-perl/
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.