Commit Graph

1179 Commits

Author SHA1 Message Date
Jean-Marie Renouard
2a63ffdcd3
Merge pull request #542 from grooverdan/doc_mysql_mariadb_support
Doc mysql mariadb support
2021-02-01 17:07:52 +01:00
Jean-Marie Renouard
05925cf12e
Merge pull request #541 from grooverdan/travis_percona
travis: add percona supported versions
2021-02-01 17:07:14 +01:00
Jean-Marie Renouard
f93020f6a5
Merge pull request #540 from grooverdan/noinnodb
correct messages on no InnoDB
2021-02-01 17:07:00 +01:00
Daniel Black
bfeccad220 travis: add percona supported versions
Note where Percona announce 3 more years of 5.6 support
https://www.percona.com/blog/2020/12/07/not-ready-to-give-up-mysql-5-6-get-post-eol-support-from-percona/
2021-02-01 15:11:34 +11:00
Daniel Black
b85a443dce doc: 5.5 listed as full support 2021-02-01 15:10:25 +11:00
Daniel Black
5901f5191b doc: MariaDB-10.[01] were not support by MySQL 2021-02-01 15:00:43 +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
Jean-Marie Renouard
950df575cd
Merge pull request #539 from grooverdan/serverlog
--server-log enhancements for containers/pods/systemd journal
2021-01-31 22:09:26 +01: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
625d2cf668
Merge pull request #534 from grooverdan/travis_new
travis: test all supported versions
2021-01-29 22:22:50 +01:00
Daniel Black
be5809e838 travis: docker test all versions 2021-01-29 08:19:18 +11:00
Jean-Marie Renouard
8cda55aa60
Merge pull request #532 from grooverdan/m10.5-travis-fix
travis: correct MariaDB-10.5 test
2021-01-28 18:21:58 +01: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
Daniel Black
85dc9551c5 travis: correct MariaDB-10.5 test 2021-01-28 11:34:23 +11:00
Jean-Marie Renouard
299944627e
Merge pull request #529 from grooverdan/supported_versions
supported version: +mariadb-10.5, eol mysql-5.6, mariadb-10.[01]
2021-01-27 21:32:37 +01: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
Jean-Marie Renouard
3a7bf40c83
Merge pull request #524 from grooverdan/aria_myisam
Aria/MyISAM cleanup
2021-01-27 21:27:12 +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
083dc22c60 supported version: +mariadb-10.5, eol mysql-5.6, mariadb-10.[01]
Add mariadb-10.5 as a supported version.

Remove MySQL/MariaDB eol versions from their origin of support.
2021-01-27 17:34:02 +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
Jean-Marie Renouard
9a9ff555ee
Update README.md 2020-12-29 15:14:36 +01:00
Jean-Marie Renouard
374b34430e
Update README.md 2020-12-29 15:14:11 +01:00
Jean-Marie Renouard
ea6a33264b
Add a simple Logo 2020-12-29 15:11:43 +01:00
Jean-Marie Renouard
df56ff11ad
Merge pull request #519 from sergey-dryabzhinsky/sergey-dryabzhinsky-patch-1
For #518 - use new schema for mariab-10.2+ to make passwords check
2020-12-27 19:41:59 +01: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
Jean-Marie Renouard
b8effe6410
Merge pull request #516 from grooverdan/supported_versions
MariaDB-10.1 EOL, MariaDB-10.5 is GA
2020-12-08 08:29:44 +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
Jean-Marie Renouard
de4b145e96 Remove innodb_buffer_pool_instances recommendations for MariaDB #512
Remove innodb_buffer_pool_instances recommendations for MariaDB #512
2020-11-16 20:22:24 +01:00
Jean-Marie Renouard
b5718d0e2f Merge branch 'master' of https://github.com/major/MySQLTuner-perl 2020-11-05 17:29:32 +01:00