ITPub博客

首页 > 数据库 > MySQL > mysqltuner

mysqltuner

原创 MySQL 作者:wwjfeng 时间:2026-02-05 22:57:15 0 删除 编辑

1.下载

https://github.com/major/MySQLTuner-perl 
wget http://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/jmrenouard/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
wget https://raw.githubusercontent.com/jmrenouard/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv

2.使用方法

#基本功能
perl mysqltuner.pl --host 127.0.0.1 --port 3306 --user root --pass yourpassword
#详细报告
perl mysqltuner.pl --host 127.0.0.1 --port 3306 --user root --pass rootroot --verbose
perl mysqltuner.pl --buffers --dbstat --idxstat --sysstat --pfstat --tbstat
#为您的 MariaDB 或 MySQL 版本启用 CVE 漏洞检查
perl mysqltuner.pl --cvefile=vulnerabilities.csv
#将显示的信息写入文件中
perl mysqltuner.pl --outputfile /tmp/result_mysqltuner.txt
#将结果写入文件,不输出信息
perl mysqltuner.pl --silent --outputfile /tmp/result_mysqltuner.txt
#新 MySQLTuner 及其数据文件
perl mysqltuner.pl --checkversion --updateversion
#使用 JSON 格式(--json)生成报告
perl mysqltuner.pl --verbose --json > reports.json

3.数据库中特定的 mysqltuner 用户

CREATE USER 'mysqltuner'@'localhost' identified by 'mysqltuner';
grant SELECT, PROCESS,EXECUTE, REPLICATION CLIENT,SHOW DATABASES,SHOW VIEW ON *.* TO 'mysqltuner'@'localhost';
flush privileges;


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15412087/viewspace-3110065/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: OPTIMIZER TRACE
请登录后发表评论 登录
全部评论

注册时间:2010-03-27

  • 博文量
    57
  • 访问量
    199175