MYSQLTUNER(1)

πŸ’– MYSQLTUNER(1) πŸ’–

User Contributed Perl Documentation β€” yes bestie, it's mysqltuner, and it's about to become your entire personality 🫢


🌸 NAME 🌸

MySQLTuner 2.9.2 β€” MySQL High Performance Tuning Advisor for MySQL, MariaDB, and Percona Server ✨

Like, it reads your database's aura and tells it what's wrong. No cap. πŸ‘‘


✨ SYNOPSIS ✨

mysqltuner [OPTIONS]

And here's all the ways you can run it, okay, pick your fighter πŸ’…

# 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 🚨

Bestie. Read this part. I'm so serious. πŸ™ˆ

  • Production Stability: Run the script without modifying arguments first to review recommendations before applying changes. Like, look before you leap, babe πŸ’€
  • Representative Workload: Let your database server run under normal production load for at least 24 to 48 hours before you trust any metric ratios or sizing advice. It needs time to cook πŸ“
  • Privilege Requirements: You need administrative read-only access β€” that's "SELECT", "PROCESS", "SHOW DATABASES", "REPLICATION CLIENT" β€” for exhaustive diagnostics. No privileges, no tea β˜•
  • Remote Host Hardware Sizing: When you're connecting over TCP/IP or SSH to remote instances, specify host RAM via "--forcemem" (e.g. "--forcemem 32G") so your buffer sizing recs are actually accurate. Don't skip this one 🌈

🌟 OPTIONS 🌟

πŸ”Œ Connection and Authentication Options

  • --host hostname β€” Connect to a remote MySQL/MariaDB server via TCP/IP hostname or IP address. Long-distance relationship, but make it networking πŸ’Œ
  • --port port β€” TCP/IP port number to connect to (default: 3306).
  • --socket socket_path β€” Path to the local UNIX domain socket for database communication. The cozy local route 🏠
  • --user username β€” Database username for authentication.
  • --password password, --pass password β€” Database password for authentication.
  • --ask-pass β€” Prompt you interactively for the database password right there 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, read after the standard defaults.
  • --login-path path β€” Read credentials from a MySQL encrypted login path (via "mysql_config_editor"). Secrets but encrypted, we love to see it πŸ”
  • --mysqlcmd path β€” Path to a custom "mysql" client binary.
  • --mysqladmin path β€” Path to a custom "mysqladmin" binary.
  • --tli β€” Use the Transport Layer Interface abstraction.
  • --ssl-ca path β€” Path to the 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 β€” Run diagnostics inside a running Docker or Podman container. Container bestie rights 🐳
  • --ssh-host hostname β€” Run diagnostics over SSH remote transport.
  • --ssh-user username β€” SSH login username.
  • --ssh-key path β€” Path to your SSH private key file. Guard it with your life πŸ”‘
  • --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 the host (e.g., "16G", "1024M", "128K").
  • --forceswap size β€” Amount of configured swap space on the host (e.g., "4G", "2048M").
  • --skipworkload β€” Bypass high-cardinality table churn and auto-increment exhaustion checks.
  • --skippassword β€” Skip the offline dictionary checks for weak user passwords.
  • --skipsize β€” Skip table size enumeration queries on "information_schema". Queries are expensive, we're being polite πŸ’Έ
  • --buffers β€” Print detailed per-buffer memory allocations.
  • --cvefile path β€” Path to a custom CVE vulnerabilities CSV database file.
  • --passwordfile path β€” Path to a custom dictionary file for password audits.
  • --checkversion β€” Check for upstream MySQLTuner version updates. Are we out of date? Let's find out πŸ‘€
  • --nondedicated β€” Adjust tuning formulas assuming the host runs non-database workloads too. Sharing is caring, but math must adapt 🀝
  • --noprocess β€” Skip OS-level non-mysqld process enumeration.

πŸ“€ Output and Export Options

  • --verbose, -v β€” Activate full verbose output, including storage engines and table statistics. Give me everything πŸ—£οΈ
  • --silent β€” Suppress standard console output. Shhh 🀫
  • --outputfile path β€” Save the console report to a plain text file.
  • --reportfile [path] β€” Generate an interactive, self-contained HTML diagnostic dashboard. Iconic behavior, honestly πŸ“Š
  • --json β€” Output raw diagnostic results as a JSON string.
  • --prettyjson β€” Output diagnostic results as formatted, indented JSON.
  • --agent-json β€” Output an actionable AI remediation schema with SQL/config fixes and rollback statements. It's giving robot bestie πŸ€–
  • --yaml β€” Output diagnostic metrics in YAML format.
  • --dumpdir path β€” Dump diagnostic data files and Markdown schema summaries to the target directory.
  • --schemadir path β€” Export individual Markdown documentation files with Mermaid ER diagrams, per schema. Diagrams?? We're fancy now πŸŽ€
  • --nocolor β€” Disable ANSI color codes in terminal output. (Sad, but sometimes necessary for logs, ngl.)
  • --noprettyicon β€” Use plain text markers ([OK], [!!], [--]) instead of Unicode icons.
  • --stage-timings β€” Display the execution duration for each analysis stage. Stopwatch era ⏱️

πŸ› 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. Ignorance is bliss, I guess πŸ™ˆ
  • --nogood β€” Suppress positive / passing health checks. Doom mode only πŸ’€
  • --noinfo β€” Suppress informational messages.

🏷️ VERSION 🏷️

Version 2.9.2 β€” she's current, she's cute, she's stable ✨


πŸ“– 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. For the girlies who want to know how the sausage is made πŸ”


πŸ‘‘ AUTHORS πŸ‘‘

Major Hayden - major@mhtx.net Jean-Marie Renouard - jmrenouard@gmail.com

Legends, both of them. Bow down 🫢


πŸ’œ CONTRIBUTORS πŸ’œ

The whole squad, no cap:

  • 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

Every single one of y'all ate πŸ’…


πŸ†˜ 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

Go on, clone it. You know you want to πŸ‘€


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/>.

Fr fr, read the license. It's free software, which is the best kind of software πŸ’–

Okay that's the whole page, bestie!! πŸ¦‹ Run it, love it, tune your database, and remember: this manual was delivered by perl v5.42.3 on 2026-08-20. Slay βœ¨πŸ‘‘πŸ’…

πŸ“¦ where this page comes from