MK-VARI...-ADVISOR(1)
π mk-variable-advisor π
okay so bestie, this is the manual page for mk-variable-advisor from the User Contributed Perl Documentation corner of the universe. It reads your MySQL variables and tells you which ones are giving π© red flag energy. Let's get into it. π
β¨ NAME β¨
mk-variable-advisor β analyze MySQL variables and advise on possible problems. That's it. That's the whole job. She reads the vibes, she clocks the problems. π
πΈ SYNOPSIS πΈ
Usage: mk-variable-advisor [OPTION...] [DSN]
mk-variable-advisor analyzes variables and advises on possible problems. No cap.
Want SHOW VARIABLES from localhost? Say less:
mk-variable-advisor localhost
Got SHOW VARIABLES output already saved in vars.txt? Iconic, we love a prepared queen:
mk-variable-advisor --source-of-variables vars.txt
π«Ά RISKS π«Ά
Okay so this section exists to be honest with you about what could go wrong, whether we know about it or not. The two main categories of risk are:
- the risk that comes from the nature of the tool itself (like, is it read-only or read-write?)
- the risk that comes from bugs π
mk-variable-advisor reads MySQL's configuration and examines it, so it's very low risk. She's a reader, not a writer. She minds her business. β¨
At the time of this release, we know of no bugs that could cause serious harm to users. Slay.
The authoritative source for updated information is always the online issue tracking system. Issues that affect this tool will be marked as such. You can see a list of such issues at this URL:
http://www.maatkit.org/bugs/mk-variable-advisor
Also go peek at "BUGS" for more info on filing bugs and getting help. π¦
π DESCRIPTION π
mk-variable-advisor examines SHOW VARIABLES for bad values and settings according to the "RULES" described below. It reports on variables that match the rules, so you can find bad settings in your MySQL server. Basically she's your group chat friend who reads the whole conversation and then tells you which message was the problem. π
At the time of this release, mk-variable-advisor only examines SHOW VARIABLES, but other input sources are planned, like SHOW STATUS and SHOW SLAVE STATUS. Future era incoming. β¨
π RULES π
These are the rules that mk-variable-advisor will apply to SHOW VARIABLES. Each rule has three parts: an ID, a severity, and a description.
- The rule's ID is a short, unique name for the rule. It usually relates to the variable that the rule examines. If a variable is examined by several rules, then the rules' IDs are numbered like
-1,-2,-N. π - The rule's severity is an indication of how important it is that this rule matched a query. We use
NOTE,WARN, andCRITto denote these levels. - The rule's description is a textual, human-readable explanation of what it means when a variable matches this rule. Depending on the verbosity of the report you generate, you will see more of the text in the description. By default, you'll see only the first sentence, which is sort of a terse synopsis of the rule's meaning. At a higher verbosity, you'll see subsequent sentences. π
auto_increment
severity: note
Are you trying to write to more than one server in a dual-master or ring replication configuration? π This is potentially very dangerous and in most cases is a serious mistake. Most people's reasons for doing this are actually not valid at all. Bestie. Please. π
concurrent_insert
severity: note
Holes (spaces left by deletes) in MyISAM tables might never be reused. π³οΈ
connect_timeout
severity: note
A large value of this setting can create a denial of service vulnerability. Not the vibe. π
debug
severity: crit
Servers built with debugging capability should not be used in production because of the large performance impact. Periodt. π«
delay_key_write
severity: warn
MyISAM index blocks are never flushed until necessary. If there is a server crash, data corruption on MyISAM tables can be much worse than usual. π
flush
severity: warn
This option might decrease performance greatly. It's giving anti-slay.
flush_time
severity: warn
This option might decrease performance greatly. (Yes, again. She's thorough. π )
have_bdb
severity: note
The BDB engine is deprecated. If you aren't using it, you should disable it with the skip_bdb option. π§
init_connect
severity: note
The init_connect option is enabled on this server. π
init_file
severity: note
The init_file option is enabled on this server. π
init_slave
severity: note
The init_slave option is enabled on this server. π
innodb_additional_mem_pool_size
severity: warn
This variable generally doesn't need to be larger than 20MB.
innodb_buffer_pool_size
severity: warn
The InnoDB buffer pool size is unconfigured. In a production environment it should always be configured explicitly, and the default 10MB size is not good. π
innodb_checksums
severity: warn
InnoDB checksums are disabled. Your data is not protected from hardware corruption or other errors! π¨
innodb_doublewrite
severity: warn
InnoDB doublewrite is disabled. Unless you use a filesystem that protects against partial page writes, your data is not safe! π¨
innodb_fast_shutdown
severity: warn
InnoDB's shutdown behavior is not the default. This can lead to poor performance, or the need to perform crash recovery upon startup. π
innodb_flush_log_at_trx_commit-1
severity: warn
InnoDB is not configured in strictly ACID mode. If there is a crash, some transactions can be lost. π
innodb_flush_log_at_trx_commit-2
severity: warn
Setting innodb_flush_log_at_trx_commit to 0 has no performance benefits over setting it to 2, and more types of data loss are possible. If you are trying to change it from 1 for performance reasons, you should set it to 2 instead of 0. Slay responsibly. β¨
innodb_force_recovery
severity: warn
InnoDB is in forced recovery mode! This should be used only temporarily when recovering from data corruption or other bugs, not for normal usage. Temporary, bestie. Temporary. π
innodb_lock_wait_timeout
severity: warn
This option has an unusually long value, which can cause system overload if locks are not being released.
innodb_log_buffer_size
severity: warn
The InnoDB log buffer size generally should not be set larger than 16MB. If you are doing large BLOB operations, InnoDB is not really a good choice of engines anyway. π«
innodb_log_file_size
severity: warn
The InnoDB log file size is set to its default value, which is not usable on production systems. π©
innodb_max_dirty_pages_pct
severity: note
The innodb_max_dirty_pages_pct is lower than the default. This can cause overly aggressive flushing and add load to the I/O system.
flush_time
severity: warn
This setting is likely to cause very bad performance every flush_time seconds. (Yes, flush_time gets two entries. She said it twice because she means it. π
)
key_buffer_size
severity: warn
The key buffer size is unconfigured. In a production environment it should always be configured explicitly, and the default 8MB size is not good. π
large_pages
severity: note
Large pages are enabled. β¨
locked_in_memory
severity: note
The server is locked in memory with --memlock. π
log_warnings-1
severity: note
Log_warnings is disabled, so unusual events such as statements unsafe for replication and aborted connections will not be logged to the error log. π
log_warnings-2
severity: note
Log_warnings must be set greater than 1 to log unusual events such as aborted connections.
low_priority_updates
severity: note
The server is running with non-default lock priority for updates. This could cause update queries to wait unexpectedly for read queries.
max_binlog_size
severity: note
The max_binlog_size is smaller than the default of 1GB.
max_connect_errors
severity: note
max_connect_errors should probably be set as large as your platform allows.
max_connections
severity: warn
If the server ever really has more than a thousand threads running, then the system is likely to spend more time scheduling threads than really doing useful work. This variable's value should be considered in light of your workload. π§
myisam_repair_threads
severity: note
myisam_repair_threads > 1 enables multi-threaded repair, which is relatively untested and is still listed as beta-quality code in the official documentation. π
old_passwords
severity: warn
Old-style passwords are insecure. They are sent in plain text across the wire. π©
optimizer_prune_level
severity: warn
The optimizer will use an exhaustive search when planning complex queries, which can cause the planning process to take a long time. π
port
severity: note
The server is listening on a non-default port.
query_cache_size-1
severity: note
The query cache does not scale to large sizes and can cause unstable performance when larger than 128MB, especially on multi-core machines.
query_cache_size-2
severity: warn
The query cache can cause severe performance problems when it is larger than 256MB, especially on multi-core machines. π
read_buffer_size-1
severity: note
The read_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it.
read_buffer_size-2
severity: warn
The read_buffer_size variable should not be larger than 8MB. It should generally be left at its default unless an expert determines it is necessary to change it. Making it larger than 2MB can hurt performance significantly, and can make the server crash, swap to death, or just become extremely unstable. π
read_rnd_buffer_size-1
severity: note
The read_rnd_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it.
read_rnd_buffer_size-2
severity: warn
The read_rnd_buffer_size variable should not be larger than 4M. It should generally be left at its default unless an expert determines it is necessary to change it.
relay_log_space_limit
severity: warn
Setting relay_log_space_limit is relatively rare, and could cause an increased risk of previously unknown bugs in replication. π
slave_net_timeout
severity: warn
This variable is set too high. This is too long to wait before noticing that the connection to the master has failed and retrying. This should probably be set to 60 seconds or less. It is also a good idea to use mk-heartbeat to ensure that the connection does not appear to time out when the master is simply idle. π«Ά
slave_skip_errors
severity: crit
β¦and to finish that one off, bestie:
You should not set this option. If replication is having errors, you need to find and resolve the cause of that; it is likely that your slave's data is different from the master. You can find out with mk-table-checksum.
sort_buffer_size-1
severity: note
The sort_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it. π
sort_buffer_size-2
severity: note
The sort_buffer_size variable should generally be left at its default unless an expert determines it is necessary to change it. Making it larger than a few MB can hurt performance significantly, and can make the server crash, swap to death, or just become extremely unstable. π Like bestie. Do not.
sql_notes
severity: note
This server is configured not to log Note level warnings to the error log.
sync_frm
severity: warn
It is best to set sync_frm so that .frm files are flushed safely to disk in case of a server crash. π«Ά
tx_isolation-1
severity: note
This server's transaction isolation level is non-default.
tx_isolation-2
severity: warn
Most applications should use the default REPEATABLE-READ transaction isolation level, or in a few cases READ-COMMITTED.
expire_log_days
severity: warn
Binary logs are enabled, but automatic purging is not enabled. If you do not purge binary logs, your disk will fill up. If you delete binary logs externally to MySQL, you will cause unwanted behaviors. Always ask MySQL to purge obsolete logs, never delete them externally. π¨ Never ever.
innodb_file_io_threads
severity: note
This option is useless except on Windows. π
innodb_data_file_path
severity: note
Auto-extending InnoDB files can consume a lot of disk space that is very difficult to reclaim later. Some people prefer to set innodb_file_per_table and allocate a fixed-size file for ibdata1.
innodb_flush_method
severity: note
Most production database servers that use InnoDB should set innodb_flush_method to O_DIRECT to avoid double-buffering, unless the I/O system is very low performance.
innodb_locks_unsafe_for_binlog
severity: warn
This option makes point-in-time recovery from binary logs, and replication, untrustworthy if statement-based logging is used. π
innodb_support_xa
severity: warn
MySQL's internal XA transaction support between InnoDB and the binary log is disabled. The binary log might not match InnoDB's state after crash recovery, and replication might drift out of sync due to out-of-order statements in the binary log.
log_bin
severity: warn
Binary logging is disabled, so point-in-time recovery and replication are not possible. π
log_output
severity: warn
Directing log output to tables has a high performance impact.
max_relay_log_size
severity: note
A custom max_relay_log_size is defined.
myisam_recover_options
severity: warn
myisam_recover_options should be set to some value such as BACKUP,FORCE to ensure that table corruption is noticed.
storage_engine
severity: note
The server is using a non-standard storage engine as default.
sync_binlog
severity: warn
Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability.
tmp_table_size
severity: note
The effective minimum size of in-memory implicit temporary tables used internally during query execution is min(tmp_table_size, max_heap_table_size), so max_heap_table_size should be at least as large as tmp_table_size.
old mysql version
severity: warn
These are the recommended minimum version for each major release: 3.23, 4.1.20, 5.0.37, 5.1.30.
end-of-life mysql version
severity: note
Every release older than 5.1 is now officially end-of-life. π (rest in power)
β¨ OPTIONS β¨
This tool accepts additional command-line arguments. Refer to the "SYNOPSIS" and usage information for details.
--ask-passβ Prompt for a password when connecting to MySQL. π--charsetβ short form:-A; type:string. Default character set. If the value isutf8, sets Perl'sbinmodeonSTDOUTtoutf8, passes themysql_enable_utf8option toDBD::mysql, and runsSET NAMES UTF8after connecting to MySQL. Any other value setsbinmodeonSTDOUTwithout theutf8layer, and runsSET NAMESafter connecting to MySQL.--configβ type:Array. Read this comma-separated list of config files; if specified, this must be the first option on the command line. π--[no]continue-on-errorβ default:yes. Continue working even if there is an error. No cap, she keeps going. πͺ--daemonizeβ Fork to the background and detach from the shell. POSIX operating systems only.--defaults-fileβ short form:-F; type:string. Only read mysql options from the given file. You must give an absolute pathname.--helpβ Show help and exit.--hostβ short form:-h; type:string. Connect to host.--ignore-rulesβ type:hash. Ignore these rule IDs. Specify a comma-separated list of rule IDs (e.g.LIT.001,RES.002,etc.) to ignore.--passwordβ short form:-p; type:string. Password to use when connecting.--pidβ type:string. Create the given PID file when daemonized. The file contains the process ID of the daemonized instance. The PID file is removed when the daemonized instance exits. The program checks for the existence of the PID file when starting; if it exists and the process with the matching PID exists, the program exits.--portβ short form:-P; type:int. Port number to use for connection.--set-varsβ type:string; default:wait_timeout=10000. Set these MySQL variables. Immediately after connecting to MySQL, this string will be appended toSETand executed.--socketβ short form:-S; type:string. Socket file to use for connection.--source-of-variablesβ type:string; default:mysql. Read"SHOW VARIABLES"from this source. Possible values are"mysql","none"or a file name. If"mysql"is specified then you must also specify a DSN on the command line.--userβ short form:-u; type:string. User for login if not current user.--verboseβ short form:-v; cumulative:yes; default:1. Increase verbosity of output. At the default level of verbosity, the program prints only the first sentence of each rule's description. At higher levels, the program prints more of the description. π£οΈ--versionβ Show version and exit.
π DSN OPTIONS π
These DSN options are used to create a DSN. Each option is given like "option=value". The options are case-sensitive, so P and p are not the same option. There cannot be whitespace before or after the "=" and if the value contains whitespace it must be quoted. DSN options are comma-separated. See the maatkit manpage for full details.
Aβ dsn:charset; copy:yes
Default character set.
Dβ dsn:database; copy:yes
Default database.
Fβ dsn:mysql_read_default_file; copy:yes
Only read default options from the given file
hβ dsn:host; copy:yes
Connect to host.
pβ dsn:password; copy:yes
Password to use when connecting.
Pβ dsn:port; copy:yes
Port number to use for connection.
Sβ dsn:mysql_socket; copy:yes
Socket file to use for connection.
uβ dsn:user; copy:yes
User for login if not current user.
π¦ DOWNLOADING π¦
You can download Maatkit from Google Code at http://code.google.com/p/maatkit/, or you can get any of the tools easily with a command like the following:
wget http://www.maatkit.org/get/toolname
or
wget http://www.maatkit.org/trunk/toolname
Where "toolname" can be replaced with the name (or fragment of a name) of any of the Maatkit tools. Once downloaded, they're ready to run; no installation is needed. The first URL gets the latest released version of the tool, and the second gets the latest trunk code from Subversion. β¨
π ENVIRONMENT π
The environment variable "MKDEBUG" enables verbose debugging output in all of the Maatkit tools:
MKDEBUG=1 mk-....
π SYSTEM REQUIREMENTS π
You need the following Perl modules: DBI and DBD::mysql.
π BUGS π
For a list of known bugs see http://www.maatkit.org/bugs/mk-variable-advisor.
Please use Google Code Issues and Groups to report bugs or request support: http://code.google.com/p/maatkit/. You can also join #maatkit on Freenode to discuss Maatkit.
Please include the complete command-line used to reproduce the problem you are seeing, the version of all MySQL servers involved, the complete output of the tool when run with "--version", and if possible, debugging output produced by running with the "MKDEBUG=1" environment variable. π«Ά (help us help you bestie)
π COPYRIGHT, LICENSE AND WARRANTY π
This program is copyright 2009-2011 Percona Inc. Feedback and improvements are welcome.
THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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, version 2; OR the Perl Artistic License. On UNIX and similar systems, you can issue man perlgpl or man perlartistic to read these licenses.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
π AUTHOR π
Baron Schwartz, Daniel Nichter
β ABOUT MAATKIT β
This tool is part of Maatkit, a toolkit for power users of MySQL. Maatkit was created by Baron Schwartz; Baron and Daniel Nichter are the primary code contributors. Both are employed by Percona. Financial support for Maatkit development is primarily provided by Percona and its clients.
πΈ VERSION πΈ
This manual page documents Ver 1.0.2 Distrib 7540 $Revision: 7477 $.
and that's a wrap, bestie πβ¨ This page you just read is perl v5.42.0, dated 2025-07-24, and it lives in section MK-VARI...-ADVISOR(1) of your man pages. Go be the main character of your own database. π
π¦
π¦ where this page comes from
- fedora 43: maatkit 7540-39.fc43 Β· GPL-2.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms