Currently, when a key_buffer_size=0 is applied, MySQLTuner sets pct_key_buffer_used=0 but still shows it as "[!!]" (bad), recommending to adjust key_buffer_size to "~ 0". The idea surely was show it neither as good or bad in this case, but as debugprint, which is currently never used since pct_key_buffer_used is always defined.
This commit changes the condition to check whether pct_key_buffer_used is larger then zero, to decide whether to show good/bad (with recommendation) or a debug info without recommendation.
Signed-off-by: MichaIng <micha@dietpi.com>
The "Key buffer used" row showed 131072 bytes as 131K while it should be shown as 128K, so that it matches the multi-byte units key buffer size in the "Key buffer size / total MyISAM indexes" row below.
Furthermore, instead of calculating the used bytes from the previously calculated percentage, doing a round trip which involves rounding errors, calculate the used bytes from the variables directly which does not involve any diversion and hence no possible rounding errors.
Signed-off-by: MichaIng <micha@dietpi.com>
Altering mysql.user tables isn't something users should do.
RENAME USER has existed for a long time, use this instead.
Also change SpecificDNSorIp because DNS based grants are
a horrible idea, fragile, and could be disabled with
--skip-name-resolve.
closes#536
enginestats are only populated if tables exist of that type.
Look at default_storage_engine if defined to communicate the default
storage engine.
closes#469
Default to reading last 30000 lines.
If reading from file estimate that average line
length is 80 characters and read based that
far back from the end of file.
This allows a user to specify a logrotated file
or another file that isn't discoverable from
server log_error system variable or other defaults.
close#504
Information schema access isn't particularly well optimized.
As such, at least in older versions, fetching from the information_schema.TABLES
would involve opening every table.
The ANSI SQL standards SCHEMATA provides a quicker way, and we can reuse it.