MySQL 性能建议者:mysqltuner.pl
- 官网:GitHub - major/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.
- Test result are available here:
-
MySQL 8.0, 8.2, 8.3 (full support)
-
Percona Server 8.0, 8.2, 8.3 (full support)
-
MariaDB 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2 (full support)
-
Galera replication (full support)
-
Percona XtraDB cluster (full support)
-
Mysql Replications (partial support, no test environment)
-
(1) 使用方法
① 本地
perl mysqltuner.pl
② 远程
perl mysqltuner.pl --host targetDNS_IP --user admin_user --passadmin_password
./mysqltuner.pl --host 10.10.1.27 --user root --pass XXXXXXXX --forcemem 5000
③ 在没有调试的情况下启用 MySQL 的最大输出信息
perl mysqltuner.pl --verbose
perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat
④ 输出到文件
perl mysqltuner.pl --outputfile /tmp/result_mysqltuner2.txt
(2) 帮助
./mysqltuner.pl --help