mysqltuner

时间:2023-03-09 18:22:44
mysqltuner

http://mysqltuner.com/

MySQLTuner-perl

MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability.

View the Project on GitHubmajor/MySQLTuner-perl

MySQLTuner-perl

MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.

[root@server-mysql ~]# perl mysqltuner.pl --host 127.0.0.1 --user root --password "" --port
>> MySQLTuner 1.6. - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering [--] Skipped version check for MySQLTuner script
[--] Performing tests on 127.0.0.1:
[OK] Logged in using credentials passed on the command line
[OK] Currently running supported MySQL version 5.6.
[OK] Operating on -bit architecture -------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in InnoDB tables: 2G (Tables: )
[OK] Total fragmented tables: -------- Security Recommendations ------------------------------------------------------------------
[!!] User '@localhost' is an anonymous account.
[!!] User '@server-mysql' is an anonymous account.
[!!] User '@localhost' has no password set.
[!!] User '@server-mysql' has no password set.
[!!] User 'root@%' has no password set.
[!!] User 'root@127.0.0.1' has no password set.
[!!] User 'root@::1' has no password set.
[!!] User 'root@localhost' has no password set.
[!!] User 'root@server-mysql' has no password set.
[!!] User '@localhost' has user name as password.
[!!] User '@server-mysql' has user name as password.
[!!] User 'root@%' hasn't specific host restriction.
[!!] There is no basic password file list! -------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined -------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 3h 24m 11s (1K q [0.160 qps], conn, TX: 3M, RX: 91K)
[--] Reads / Writes: % / %
[--] Binary logging is disabled
[--] Physical Memory : .3G
[--] Max MySQL memory : 646.7M
[--] Other process memory: 154.7M
[--] Total buffers: 73.0M global + 1.1M per thread ( max threads)
[--] P_S Max memory usage: 403M
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 480.2M (36.03% of installed RAM)
[OK] Maximum possible memory usage: 646.7M (48.52% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: % (/1K)
[OK] Highest usage of available connections: % (/)
[OK] Aborted connections: 0.00% (/)
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: % ( temp sorts / sorts)
[OK] No joins without indexes
[OK] Temporary tables created on disk: % ( on disk / 6K total)
[OK] Table cache hit rate: % ( open / opened)
[OK] Open file limit used: % (/5K)
[OK] Table locks acquired immediately: % ( immediate / locks) -------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is enabled.
[--] Memory used by P_S: 403.8M
[--] Sys schema is installed. -------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled. -------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.3% (1M used / 8M cache)
[OK] Key buffer size / total MyISAM indexes: 8.0M/.0K
[OK] Read Key buffer hit rate: 99.5% ( cached / reads) -------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is disabled. -------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 32.0M/.8G
[!!] InnoDB buffer pool <= 1G and innodb_buffer_pool_instances(!=).
[!!] InnoDB Used buffer: 22.77% ( used/ total)
[OK] InnoDB Read buffer efficiency: 94.41% ( hits/ total)
[!!] InnoDB Write Log efficiency: 16.67% ( hits/ total)
[OK] InnoDB log waits: 0.00% ( waits / writes) -------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled. -------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled. -------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server. -------- Recommendations ---------------------------------------------------------------------------
General recommendations:
Remove Anonymous User accounts - there are anonymous accounts.
Set up a Password for user with the following SQL statement ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' = PASSWORD('secure_password'); )
Set up a Secure Password for user@host ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' = PASSWORD('secure_password'); )
Restrict Host for user@% to user@SpecificDNSorIp
MySQL started within last hours - recommendations may be inaccurate
Variables to adjust:
innodb_buffer_pool_size (>= 2G) if possible.
innodb_buffer_pool_instances (=)
[root@server-mysql ~]#