mysql一键安装脚本win_MySQLTuner-perl实用脚本--一键生成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 http://mysqltuner.pl/ -O mysqltuner.plwget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txtwget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
d4efa845d4e1af7eb96c9c43b42506a7.png

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、实例

简单测试如下:

4488af848904d1e2564fad50793c6662.png
8a390119c10f0e948143af92741da81e.png
613f2158b9a54e019d99d7f588cc01ce.png
6da2efdf7916728f9ee30f8e3e74eac2.png
perl mysqltuner.pl --host localhost --user root --pass 密码 --buffers --dbstat --idxstat --sysstat --pfstat --tbstat
2400151ccd737891f1bb1c96e8b4fd82.png

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


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

c94f5cf28cfba1753cfc929ca06c0c5b.gif
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值