Commit graph

823 commits

Author SHA1 Message Date
jyyo0n
8f2e1b36f5
Update mysqltuner.pl
Innodb Log Writes may be zero right after DB startup. 
In order to prevent division by zero error in line 6175, it is necessary to check whether it is greater than 0.
$mystat{'Innodb_log_writes'} > 0.000001
2023-04-14 16:44:50 +09:00
Jean-Marie Renouard
29ad424da2 Merge branch 'master' of https://github.com/jmrenouard/MySQLTuner-perl 2023-04-13 00:56:51 +02:00
Jean-Marie Renouard
8e6b61ed10 Rearrange UNIX rights 2023-04-12 22:06:34 +02:00
Jean-Marie Renouard
af67fe8100
Merge branch 'major:master' into master 2023-04-12 20:54:58 +02:00
Jean-Marie Renouard
3164f3a727 last updates 2023-04-12 20:45:03 +02:00
Long Radix
5560381f7d
Update mysqltuner.pl 2023-03-29 12:33:47 +02:00
Long Radix
1ccba5e556
Update mysqltuner.pl
Syntax
2023-03-28 19:44:04 +02:00
Long Radix
16237f7778
Update mysqltuner.pl
Remove duplicate code comment
2023-03-28 19:30:26 +02:00
Long Radix
a3e4969538
Update mysqltuner.pl 2023-03-27 18:33:49 +02:00
Long Radix
ca04d7bce1
Typos and legibility, mark 7 2023-03-27 18:12:52 +02:00
Jean-Marie Renouard
c5cf3603fd
Merge pull request #633 from longradix/master
Remove filter that never fires
2023-03-23 10:40:59 +01:00
Jean-Marie RENOUARD
7fad4236ba Updates CVS and docs 2023-03-22 16:34:10 +01:00
Jean-Marie Renouard
43fdb3680e feat: try to auto commit result into repo 2023-03-18 17:57:06 +01:00
Long Radix
02a022c064
Update mysqltuner.pl 2023-03-16 15:03:34 +01:00
Jean-Marie Renouard
9adb7d6efd Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2023-03-14 21:40:13 +00:00
Jean-Marie Renouard
b29eb05b2b Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2023-03-11 07:48:00 +01:00
Jean-Marie Renouard
881479eca8 Adding information schema extraction into CSV file using dumpdir option 2023-03-11 07:46:01 +01:00
Long Radix
b33ad673e4
Update mysqltuner.pl
Refactor login test (#608)
2023-03-09 12:40:42 +01:00
Jean-Marie Renouard
a787631287 nice looking CSV format 2023-03-03 15:46:52 +01:00
Jean-Marie Renouard
72353f4d32 new version of select_csv_file 2023-03-03 15:43:11 +01:00
Jean-Marie Renouard
ea29f3e0d4 Dumpdir option + sysschema dump 2023-03-01 11:16:44 +01:00
Jean-Marie Renouard
c35552a652 removing message info 2023-02-28 14:42:05 +01:00
Jean-Marie Renouard
4c4bc01ff7 fix error l197 2023-02-28 14:40:12 +01:00
Jean-Marie Renouard
0113f77f27 fix on error 2023-02-28 14:39:29 +01:00
Jean-Marie Renouard
806295ccd9 add code to create dumpdir 2023-02-28 14:34:14 +01:00
Jean-Marie Renouard
a5fbb70cac Adding new options dumpsysdir 2023-02-28 13:51:46 +01:00
Long Radix
6cd8c808aa
Typos and legibility
Reuploading fixes from an earlier patch that did not make it in the latest version. Also some additional clarifications.
2023-02-27 17:49:36 +01:00
Jean-Marie Renouard
5537b67a39 Fix version 2023-02-10 18:36:32 +01:00
Jean-Marie Renouard
fe573ac578 #627 swap is off
Get an error when calling hr_bytes

Review licence informations
2023-02-10 07:22:14 +01:00
Jean-Marie Renouard
e014012217 Legibility issue upon entering credentials
#613
2023-02-02 08:33:48 +01:00
Jean-Marie Renouard
8aa8ffaa5b Legibility issue upon entering credentials
#613
2023-02-02 08:29:45 +01:00
Jean-Marie Renouard
dd085736da
Merge pull request #625 from mnalis/remove-unused-mysql_micro_version_le
remove unused mysql_micro_version_le() function
2023-01-24 09:17:29 +01:00
Matija Nalis
97f571bbbb Fix MariaDB Sys schema check 2022-12-30 15:01:46 +01:00
Matija Nalis
92e2dbb12b removed ununused mysql_micro_version_le()
duplicate of mysql_version_le()
2022-12-30 14:15:58 +01:00
Jean-Marie RENOUARD
6284e95f18 Merge branch 'master' of https://github.com/major/MySQLTuner-perl 2022-12-29 18:36:06 +01:00
Jean-Marie RENOUARD
ecb9570f29 fixing redolog capacity info 2022-12-29 18:36:02 +01:00
Jean-Marie Renouard
390977624e Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2022-12-29 05:13:02 +01:00
Jean-Marie Renouard
b345c03a7f Review version umber into 2.0.10 2022-12-29 04:49:26 +01:00
Daniel Lewart
ec165a6e2d Recommend ALTER TABLE ... FORCE for InnoDB defrag 2022-12-29 02:42:05 -06:00
Daniel Lewart
a8d3b6a5f5 Fix bug #616 get_pf_memory() returns bogus value 2022-10-31 18:30:08 -05:00
Jean-Marie Renouard
5331b3e591 [Patch] Legibility and typos, mark 5 #614 2022-10-05 10:16:42 +02:00
Jean-Marie Renouard
efb1e1bad2 I do not get, why this is showing: Outdated Version, RAM #612 2022-09-26 14:12:37 +02:00
Jean-Marie RENOUARD
fdd42e7685 Using --defaults-file ignores the .my.cnf #605 2022-09-13 15:55:35 +02:00
Jean-Marie RENOUARD
2259dfc3b2 [Patch] Legibility and typos, mark 4
#610
2022-09-13 15:17:39 +02:00
Dmitry
ce6e8cdf8d
Update mysqltuner.pl
Abbreviation have been added to the human_size function to display the size of partitions on a server with terabytes.
2022-09-08 12:46:10 +03:00
Jean-Marie Renouard
8cd40947ea typos fixes around version number 2022-08-23 11:40:21 +02:00
Jean-Marie Renouard
3bc7b6a34b Version 2.0.5 [Patch] Legibility and typos, mark 3 #602 2022-06-30 14:46:54 +02:00
Jean-Marie Renouard
ba21312e00 Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2022-06-23 14:31:46 +02:00
Jean-Marie Renouard
34bab469c4 Something broken when correcting "incorrectly reports roles as users without passwords #598" #600 2022-06-22 18:41:53 +02:00
Jean-Marie Renouard
898315d6e0 [Patch] Legibility and typos, mark 2 #599 2022-06-22 18:36:34 +02:00
Jean-Marie Renouard
5ea10e9c24 Update for MariaDB 10.8 #601 2022-06-22 18:09:54 +02:00
Jean-Marie Renouard
461c8fb60e Try to fix incorrectly reports roles as users without passwords #598" 2022-06-15 18:08:11 +02:00
Jean-Marie Renouard
3edaab3b57 Use of uninitialized value $seconds_behind_master #593 2022-06-15 15:17:55 +02:00
Jean-Marie Renouard
d2dcd7281d Update needed for MariaDB 10.7 #594 2022-06-15 15:11:34 +02:00
Jean-Marie Renouard
cf568a8f43 version 1.9.9 - Legibility and typos #597 2022-06-15 14:43:18 +02:00
Mark Ruys
9fdd43787c Fix some master/slave renaming issues (2) 2022-04-04 10:53:04 +02:00
Jean-Marie Renouard
77b313bf92 --updateversion saves updates to incorrect location #499 2022-03-28 23:03:57 +02:00
Jean-Marie Renouard
e1524048cf --updateversion saves updates to incorrect location #499 2022-03-28 23:02:47 +02:00
Jean-Marie Renouard
8347472947 innodb_buffer_pool_instances(=16) suggested for MariaDB 10.5 which doesn t support it #588 2022-03-28 22:53:31 +02:00
Jean-Marie Renouard
4709d758b7
Merge pull request #590 from josev814/unsigned_big_int_fix
Fixing BIGINT UNSIGNED value is out of range error
2022-03-28 21:02:43 +02:00
Jose
ec66406996
Fixing BIGINT UNSIGNED value is out of range error
Making adjustments to the Fragmented tables query to allow large tables by casting the DATA_FREE from unsigned to signed.
2022-03-28 14:46:03 -04:00
Mark Ruys
35ba851cbb Fix some master/slave renaming issues 2022-03-28 14:55:33 +02:00
Jean-Marie Renouard
b425acd963 False impression on key buffer usage
#573 (3)
2022-03-12 19:14:52 +01:00
Jean-Marie Renouard
95e40e0cc3 False impression on key buffer usage
#573 (2)
2022-03-12 19:13:32 +01:00
Jean-Marie Renouard
ecd2da6be4 'name resolution is active' should be OK when cPanel is detected #561 2022-03-12 19:10:25 +01:00
Jean-Marie Renouard
0fdcda815e False impression on key buffer usage
#573
2022-03-12 18:46:42 +01:00
Jean-Marie Renouard
dd9914be88 False impression on key buffer usage
#573
2022-03-11 09:42:01 +01:00
Jean-Marie Renouard
cc4fa414d2 Fix for Recommendation to turn on performance_schema #579 2022-03-10 22:01:36 +01:00
Jean-Marie Renouard
e7f444c969 Some experimental staff + update basic template with sortable bootstrap tables 2022-03-03 20:39:47 +01:00
Rick Kuipers
09424eedfb
Remove erroneous dot 2022-02-13 17:15:44 +01:00
Jean-Marie Renouard
191b16c21b Adding a Jinja2 Template 2022-02-12 23:33:59 +01:00
Jean-Marie Renouard
f18570b96f Changing Copyright 2022-02-12 15:53:33 +01:00
Jean-Marie Renouard
c5cc4096a2 Please add support for --protocol=TCP #474 2022-02-08 00:31:00 +01:00
Jean-Marie Renouard
e437c1a3fc List unsupported storage engine 2022-02-08 00:15:59 +01:00
Jean-Marie Renouard
7db9bbeeb7 Recommendation on innodb_adaptive_hash_index_partitions #479 2022-02-07 23:57:45 +01:00
Jean-Marie Renouard
7bf727669b The InnoDB log buffer size recommendation may be tested too strictly #569 2022-02-07 23:40:35 +01:00
Jean-Marie Renouard
cd30f9c852 Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2022-02-07 23:34:34 +01:00
Jean-Marie Renouard
2b44229a8e Version 1.9.1 Incorrectly reporting performance schema is off #580
Recommendation to turn on performance_schema #579
2022-02-07 22:48:37 +01:00
Jean-Marie Renouard
55cdf92f8b Refactor dbstat part of mysqltuner 2022-02-04 22:29:04 +01:00
Jean-Marie Renouard
3ce4c603b4 Fixing mount point space information 2022-02-04 20:20:13 +01:00
Jean-Marie Renouard
f17ee46f01 Fix sql request on PErcona nad MySQL 2022-02-04 17:49:49 +01:00
Jean-Marie Renouard
747675b1ba Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2022-02-04 16:01:22 +01:00
Jean-Marie Renouard
d4d680e887 Some display fixes 2022-02-03 20:00:37 +01:00
Jean-Marie Renouard
8430b6e466 Fix MySQL index scans 2022-01-31 14:36:28 +01:00
Jean-Marie Renouard
b164a9b054 Release 1.8.8 #579 2022-01-30 15:38:54 +01:00
Jean-Marie Renouard
49218c8c4c
Merge pull request #577 from MichaIng/patch-1
Do not show thread pool metrics when disabled
2022-01-24 19:35:02 +01:00
MichaIng
93a8c0849e
Hide recommendation when no key buffer is used
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>
2022-01-24 02:23:54 +01:00
MichaIng
8ed76b05ba
Do not show thread pool metrics when disabled
Currently thread pool metrics are shown whenever the "thread_pool_size" variable is set. At least on MariaDB this variable is however set even when the thread pool is disabled. This commit changes the check for whether a thread pool is used for client connection handling or not by comparing the "thread_handling" variable value against "pool-of-threads" (MariaDB) or "loaded-dynamically" (MySQL):
- https://mariadb.com/kb/en/thread-pool-system-status-variables/#thread_handling
- https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_thread_handling

The check for whether to show the thread cache metrics is now based on the same derived internal "have_threadpool" variable, effectively skipping thread cache metrics as well on MySQL when the thread pool is not enabled with "thread_handling = loaded-dynamically". The code comment link to Percona about whether the thread cache is used with thread pool enabled has been pinned to v5.7, the latest version which contains the quoted statement. The statement is however still true for MariaDB and MySQL:
- https://mariadb.com/kb/en/server-system-variables/#thread_cache_size

Signed-off-by: MichaIng <micha@dietpi.com>
2022-01-15 18:22:47 +01:00
Jean-Marie Renouard
926c9a92ca A lot of new info about indexes and table structures 2022-01-03 18:54:54 +01:00
MichaIng
7d53af73cc
Fix key buffer usage multiple-byte units
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>
2021-11-22 14:49:23 +01:00
Jean-Marie Renouard
a146c81b7c Wrong recommendation "thread_pool_size between 16 and 36 for InnoDB usage" for Percona Server
#551"
2021-10-16 17:07:14 +02:00
Jean-Marie Renouard
0d897f8c5b
Merge pull request #568 from 64kramsystem/fix_innodb_log_buffer_size_message
Fix `innodb_log_buffer_size` message
2021-10-15 16:33:37 +02:00
Jean-Marie Renouard
6b6d85ef28 Wrong recommendation "thread_pool_size between 16 and 36 for InnoDB usage" for Percona Server (#551) 2021-10-15 16:28:19 +02:00
Jean-Marie Renouard
1333ea9395 Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2021-10-15 13:56:27 +02:00
Jean-Marie Renouard
c0251a1488 Can't locate Data/Dumper.pm in @INC #564 2021-10-15 13:43:07 +02:00
Saverio Miroddi
85d7d6b6a8 Fix innodb_log_buffer_size message
The operator used to recommend the user to increase the log buffer size (`>=`) is confusing.

Closes #567 (which includes a detailed description).
2021-10-15 10:39:03 +02:00
Jean-Marie Renouard
d04c1c46dc Increment releas number 2021-09-28 17:31:55 +02:00
Jean-Marie Renouard
5b96d08004 Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2021-09-27 12:25:12 +02:00
Steve8291
911b1294fa
Fix Replication Status
Reference Issue #553 
Reversing the check for version of mysql or mariadb to use correct command.
2021-08-26 10:21:23 -04:00
Jean-Marie Renouard
3225a954fc
Merge pull request #559 from willamowius/master
fix English grammar
2021-08-25 12:05:36 +02:00
Jean-Marie RENOUARD
1e9920b545 Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2021-08-25 12:01:28 +02:00
Jan Willamowius
6584233c72 fix English grammar 2021-07-17 08:35:44 +02:00
Jean-Marie Renouard
7aa57fa770 Illegal division by zero at ./mysqltuner.pl line 2745 #558
Wrong table cache hit rate calculation #548
2021-07-15 17:03:00 +02:00
Jean-Marie Renouard
7a2a0f1b13 Illegal division by zero at ./mysqltuner.pl line 2745 #558
Wrong table cache hit rate calculation #548
2021-07-15 17:02:24 +02:00
Jean-Marie Renouard
78d8f3ed85 Version 1.8.0: Support MariaDB 10.6 Update needed for MariaDB 10.6 #557 2021-07-13 18:56:52 +02:00
Jean-Marie Renouard
656a7e51ed Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2021-07-02 18:31:21 +02:00
Jean-Marie Renouard
8f479b06f6 Increment version 2021-07-02 18:17:57 +02:00
Jean-Marie Renouard
2079639e6b Wrong table cache hit rate calculation #548 2021-07-02 18:17:25 +02:00
Jean-Marie Renouard
213211aecc improve FreeBSD support a bit (patch included) #549 2021-07-02 16:55:43 +02:00
Jean-Marie Renouard
47cf0669fc failed to execute: SHOW SLAVE HOSTS #553 2021-07-02 16:41:36 +02:00
Jean-Marie Renouard
c9345a1380 1.7.26 is fixing minor glitch with DROP USER #555 2021-07-02 16:22:51 +02:00
Jean-Marie RENOUARD
5aa880afbc Wrong recommendation "thread_pool_size between 16 and 36 for InnoDB usage" for Percona Server #551 2021-05-03 12:00:02 +00:00
Jean-Marie Renouard
447652d325 Update mysqltuner.pl 2021-05-03 11:06:23 +02:00
Jean-Marie Renouard
ac34523609 Update mysqltuner.pl 2021-03-30 11:54:30 +02:00
Jean-Marie Renouard
68e5902169 Update mysqltuner.pl 2021-03-30 11:44:08 +02:00
Jean-Marie Renouard
a8fc0c2639 Update mysqltuner.pl
Adding more information about flow control current value
2021-03-08 18:29:03 +01:00
Jean-Marie Renouard
b0cfbd802b Duplicate recommendation/check #545
Duplicate recommendation/check #545
2021-03-08 18:02:22 +01:00
Jean-Marie Renouard
5a399f6006 Duplicate recommendation/check #545
Duplicate recommendation/check #545
2021-03-08 18:01:44 +01:00
Jean-Marie RENOUARD
ef66fb274c Update Vulnerabilities list
Indenting mysqltuner
Update Usage information
2021-02-05 15:25:09 +01:00
Daniel Black
e29b76fca1 empty passwords - use exact user/host quoted 2021-02-05 09:46:37 +11:00
Daniel Black
0be85cbb9f user host recommend - RENAME USER
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
2021-02-05 09:37:10 +11:00
Daniel Black
5c307d1813 correct messages on no InnoDB
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
2021-02-01 11:42:44 +11:00
Daniel Black
938b434e41 extend server-log for journal/container/pods
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.
2021-01-30 12:51:28 +11:00
Daniel Black
c3da0b013c add server-log option for explict server log
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
2021-01-30 10:24:03 +11:00
Jean-Marie Renouard
47ebbbca75
Merge pull request #535 from grooverdan/snap
skip snap filesystems
2021-01-28 18:21:43 +01:00
Jean-Marie Renouard
22789d1c7f
Merge pull request #537 from grooverdan/min_dblist
minimal database list retrieval
2021-01-28 18:21:11 +01:00
Jean-Marie Renouard
1f879d110b
Merge pull request #538 from grooverdan/json_total_tables
Add total_tables to json output
2021-01-28 18:19:09 +01:00
Jean-Marie Renouard
374ef59417
Merge pull request #533 from grooverdan/exec_perms
add execute permissions to mysqltuner.pl
2021-01-28 18:18:17 +01:00
Jean-Marie Renouard
49c2f6e930 Update mysqltuner.pl 2021-01-28 18:15:53 +01:00
Daniel Black
72952b5873 Add total_tables to json output
closes #484
2021-01-28 19:13:02 +11:00
Daniel Black
7a94bd5388 minimal database list retrieval
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.
2021-01-28 18:44:17 +11:00
Daniel Black
59ce37b3a1 skip snap filesystems 2021-01-28 18:01:59 +11:00
Daniel Black
2c8f5e81cf add execute permissions to mysqltuner.pl
closes #531
2021-01-28 16:22:16 +11:00
Jean-Marie Renouard
285ba51330
Merge pull request #528 from grooverdan/gtidmode_mariadb
mariadb gtid mode - base off gtid_current_pos.
2021-01-27 21:31:41 +01:00
Jean-Marie Renouard
d9e00040c8
Merge pull request #527 from grooverdan/mariadbnames
mariadb is using its on name in mariadb/mariadb-admin
2021-01-27 21:31:16 +01:00
Jean-Marie Renouard
f2c8ca86b2
Merge pull request #526 from grooverdan/anonuser
anonymous users - remove password checks
2021-01-27 21:29:38 +01:00
Jean-Marie Renouard
8fb9195c4f
Merge pull request #525 from grooverdan/qc
query_cache off with query_cache_type=OFF OR query_cache_size=0
2021-01-27 21:28:18 +01:00
Daniel Black
9d1d19c97d mariadb gtid mode - base off gtid_current_pos.
gtid_strict_mode isn't sufficient a test for
MariaDB's GTID mode. The gtid_current_pos
however is always non-blank if GTID is enabled.

closes #513
2021-01-27 18:03:41 +11:00
Daniel Black
fa8deec762 mariadb is using its on name in mariadb/mariadb-admin
The mysql client, mysql, in mariadb is starting to be labeled mariadb.
Likewise mysqladmin is getting called mariadb-admin. Lets check
for these names as well.
2021-01-27 17:26:29 +11:00
Daniel Black
2f45f349c9 anonymous users - remove password checks
For anonymous users, those with user='', having a recommendation
to set their passwords, and warning that the password is the same
as the username is a little excessive since there's already a
recommendation to drop the user.

So let's remove those recommendation so we don't see:

[!!] User '@localhost' has user name as password.
[!!] User '@localhost.localdomain' has user name as password.

or:

    Set up a Secure Password for @localhost user: SET PASSWORD FOR ''@'SpecificDNSorIp' = PASSWORD('secure_password');
    Set up a Secure Password for @localhost.localdomain user: SET PASSWORD FOR ''@'SpecificDNSorIp' = PASSWORD('secure_password');

Lets keep the focus on:
-------- Security Recommendations ------------------------------------------------------------------
[!!] User ''@'localhost' is an anonymous account. Remove with DROP USER ''@'localhost';
[!!] User ''@'localhost.localdomain' is an anonymous account. Remove with DROP USER ''@'localhost.localdomain';
2021-01-27 17:15:03 +11:00
Daniel Black
3ac95cd046 query_cache off with query_cache_type=OFF OR query_cache_size=0
From the MySQL and MariaDB code (same - 5.5 version):
https://github.com/mysql/mysql-server/blob/5.5/sql/sql_cache.h#L560
https://github.com/MariaDB/server/blob/5.5/sql/sql_cache.h#L572

This is used:
https://github.com/mysql/mysql-server/blob/5.5/sql/sql_prepare.cc#L3058
(same in MariaDB code)

The size=0 and type=0 are both sufficent conditions for the query
cache to be disabled. As such lets consider it ok if its disabled
only in one place. This is the case in mariadb where type=0 (OFF)
is the default as is a non-zero query-cache size.
2021-01-27 17:02:58 +11:00
Daniel Black
99e5c83779 Aria/MyISAM cleanup
Include calculation of Aria index size based of *.MAI files.

Use find -0 | xargs -0 to allow for space containing names.
Quote datadir in find in case it had spaces.

Use xargs -r (GNU extension) (supported Linux, FreeBSD, OpenBSD,
NetBSD, not Solaris, not OSX) to not run if there's no files that match.
This prevents it running the total of the current directory if
there are no M[YA]I files.

A total size of 0 for Aria or MyISAM indexes isn't a problem
because:
* MySQL-5.[567] used MyISAM system tables which have indexes, so 0
wasn't possible (except for remote user without mysql.* access).
* 0 size of index is equally likely to be 0 tables of this type
  (e.g. MySQL-8.0, or MariaDB-10.4+ (Aria default, not MyISAM)).

Setting total_aria_indexes=1 when it was previously 0 is misleading.

Aria was never called AriaDB despite the apparent convention in
other storage engines so use just Aria, or Aria Storage Engine
in messages.

Differentiate between Aria not available and disabled in report.
2021-01-27 15:56:10 +11:00
Sergey Dryabzhinsky
ce23262b27 Fix else+if construction 2020-12-26 12:32:59 +03:00
Sergey Dryabzhinsky
b1a1829362
For #518 - use new schema for mariab-10.2+
And check for one more column existance
2020-12-26 12:02:51 +03:00
Jean-Marie Renouard
aac1ab2b4d
Merge pull request #514 from grooverdan/mdb10.4-secure-users
secure users MariaDB-10.4+ / MySQL auth socket
2020-12-08 08:30:23 +01:00
Jean-Marie Renouard
643e5e4e98
Merge pull request #515 from grooverdan/delanonymous
DROP USER to delete anonymous accounts
2020-12-08 08:30:04 +01:00
Daniel Black
6f966dee45 MariaDB-10.1 EOL, MariaDB-10.5 is GA 2020-12-08 15:25:59 +11:00
Daniel Black
1bb30f508e DROP USER to delete anonymous accounts
DROP USER has existed for a very long time.

Use the QUOTE sql function to ensure accounts are correctly quoted
and this helps the delete recommendation.
2020-12-08 14:37:26 +11:00
Daniel Black
79a4403c9c MySQL-5.7/8.0+ auth_socket is safe
MySQL has auth_socket as its plugin compared to unix_socket on MariaDB
so accept that as a valid reason for having no authentication.

MySQL [(none)]> show create user dan@localhost;
+-----------------------------------------------------------------------------------------------------------------+
| CREATE USER for dan@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------+
| CREATE USER 'dan'@'localhost' IDENTIFIED WITH 'auth_socket' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
+-----------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)

MySQL [(none)]> select user,host,plugin from mysql.user;
+---------------+-----------+-----------------------+
| user          | host      | plugin                |
+---------------+-----------+-----------------------+
| root          | localhost | mysql_native_password |
| mysql.session | localhost | mysql_native_password |
| mysql.sys     | localhost | mysql_native_password |
| dan           | localhost | auth_socket           |
| expiretest    | %         | mysql_native_password |
| expiretest    | localhost | mysql_native_password |
+---------------+-----------+-----------------------+
6 rows in set (0.001 sec)

MySQL [(none)]> select version();
+-----------+
| version() |
+-----------+
| 5.7.31    |
+-----------+
2020-12-08 14:18:03 +11:00
Daniel Black
0eef9260a8 mariadb-10.4+ empty passwords
MariaDB-10.4 migrated their authentication to a global_priv table in JSON
format. Also locked user accounts where added. By default the mariadb.sys
is a locked user without a password and there as the owner of the mysql.user
view. As its hazardous for a user to modify this we exclude locked accounts
but still search for mysql_native_password plugin without authentication.

We use versioned comments to process all other versions. The 5.5+ MySQL
version comment is also read by MariaDB (ref: https://mariadb.com/kb/en/comment-syntax/
enabling the processing of plugins on other version that have plugins.

While this branch doesn't yet apply to MySQL-8.0 yet, we add support
for the locked user accounts in MySQL-8.0+ in a versioned comment
(not read by MariaDB).
2020-12-08 14:00:39 +11:00