龙空技术网

MySQLTuner-perl实用脚本--一键生成MySQL数据库优化建议

波波说运维 794

前言:

而今兄弟们对“mysql自动化运维脚本”可能比较关心,朋友们都需要剖析一些“mysql自动化运维脚本”的相关资讯。那么小编在网上汇集了一些对于“mysql自动化运维脚本””的相关知识,希望你们能喜欢,姐妹们一起来了解一下吧!

概述

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.

MySQLTuner supports ~300 indicators for MySQL/MariaDB/Percona Server in this last version.

今天主要分析一个实用脚本,一键生成MySQL数据库优化建议。

1、下载脚本

wget  -O mysqltuner.plwget  -O basic_passwords.txtwget  -O vulnerabilities.csv
2、用法

Usage: Minimal usage remotely

perl mysqltuner.pl --host targetDNS_IP --user admin_user --pass admin_password

Usage: Enable maximum output information around MySQL/MariaDb without debugging

perl mysqltuner.pl --verboseperl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat --tbstat

Usage: Enable CVE vulnerabilities check for your MariaDB or MySQL version

perl mysqltuner.pl --cvefile=vulnerabilities.csv

Usage: Write your result in a file with information displayed

perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt

Usage: Write your result in a file without outputting information

perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt

Usage: Using template model to customize your reporting file based on Text::Template syntax.

perl mysqltuner.pl --silent --reportfile /tmp/result_mysqltuner.txt --template=/tmp/mymodel.tmpl

Usage: Enable debugging information

perl mysqltuner.pl --debug

Usage: Update MySQLTuner and data files (password and cve) if needed

perl mysqltuner.pl --checkversion --updateversion
3、实例

简单测试如下:

perl mysqltuner.pl --host localhost --user root --pass 密码 --buffers --dbstat --idxstat --sysstat --pfstat --tbstat

剩下的就靠大家自己挖掘了...

觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~

标签: #mysql自动化运维脚本