作者:【吴业亮】

博客:https://wuyeliang.blog.csdn.net/

MySQL Tuner是一个Perl脚本,它连接到正在运行的MySQL实例,并根据工作负载提供配置建议。理想情况下,MySQL实例应该在运行脚本之前至少运行24小时。实例运行的时间越长,MySQL Tuner给出的建议就越好。

github网址如下:

https://github.com/major/MySQLTuner-perl

代码提交还是比较活跃的,目前有4.3k个star

由于这个软件是用perl写的,所有要安装perl

# yum install perl wget -y

将MySQL Tuner下载到您的主目录。

#  wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl

要运行它:

#  perl ./mysqltuner.pl

系统将要求您提供MySQL root用户的名称和密码。

执行结果如下:

[root@cloud ~]#  perl ./mysqltuner.pl>>  MySQLTuner 1.7.14 - 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
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: [OK] Currently running supported MySQL version 5.5.60-MariaDB
[OK] Operating on 64-bit architecture-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: /var/log/mariadb/mariadb.log(4K)
[OK] Log file /var/log/mariadb/mariadb.log exists
[OK] Log file /var/log/mariadb/mariadb.log is readable.
[OK] Log file /var/log/mariadb/mariadb.log is not empty
[OK] Log file /var/log/mariadb/mariadb.log is smaller than 32 Mb
[!!] /var/log/mariadb/mariadb.log contains 11 warning(s).
[OK] /var/log/mariadb/mariadb.log doesn't contain any error.
[--] 2 start(s) detected in /var/log/mariadb/mariadb.log
[--] 1) 181123 17:41:15 [Note] /usr/libexec/mysqld: ready for connections.
[--] 2) 181123 17:22:43 [Note] /usr/libexec/mysqld: ready for connections.
[--] 1 shutdown(s) detected in /var/log/mariadb/mariadb.log
[--] 1) 181123 17:40:57 [Note] /usr/libexec/mysqld: Shutdown complete-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[!!] InnoDB is enabled but isn't being used
[OK] Total fragmented tables: 0-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: ON
[!!] Stat are updated during querying INFORMATION_SCHEMA.-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] User 'nextcloud@%' does not specify hostname restrictions.
[!!] There is no basic password file list!-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 20d 22h 54m 0s (15 q [0.000 qps], 9 conn, TX: 38K, RX: 966B)
[--] Reads / Writes: 100% / 0%
[--] Binary logging is disabled
[--] Physical Memory     : 15.5G
[--] Max MySQL memory    : 1011.2M
[--] Other process memory: 0B
[--] Total buffers: 416.0M global + 2.8M per thread (214 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 418.8M (2.64% of installed RAM)
[OK] Maximum possible memory usage: 1011.2M (6.37% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (0/15)
[OK] Highest usage of available connections: 0% (1/214)
[!!] Aborted connections: 22.22%  (2/9)
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 6 selects)
[OK] Query cache prunes per day: 0
[OK] No Sort requiring temporary tables
[OK] No joins without indexes
[OK] Temporary tables created on disk: 0% (0 on disk / 4 total)
[!!] Thread cache is disabled
[OK] Table cache hit rate: 100% (26 open / 0 opened)
[OK] Open file limit used: 2% (21/1K)
[OK] Table locks acquired immediately: 100% (36 immediate / 36 locks)-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema isn't installed.-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 8 thread(s).
[--] Using default value is good enough for your version (5.5.60-MariaDB)-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.2% (24M used / 134M cache)
[OK] Key buffer size / total MyISAM indexes: 128.0M/99.0K-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is disabled.
[!!] InnoDB Storage engine is disabled. InnoDB is the default storage engine-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: STATEMENT
[--] XA support enabled: ON
[--] Semi synchronous replication Master: Not Activated
[--] Semi synchronous replication Slave: Not Activated
[--] This is a standalone server-------- Recommendations ---------------------------------------------------------------------------
General recommendations:Control warning line(s) into /var/log/mariadb/mariadb.log fileAdd skip-innodb to MySQL configuration to disable InnoDBRestrict Host for user@% to user@SpecificDNSorIpEnable the slow query log to troubleshoot bad queriesReduce or eliminate unclosed connections and network issuesSet thread_cache_size to 4 as a starting value
Variables to adjust:SET innodb_stats_on_metadata = OFFquery_cache_size (=0)query_cache_type (=0)query_cache_limit (> 1M, or use smaller result sets)thread_cache_size (start at 4)

mysql优化工具 MySQL Tuner相关推荐

  1. 4 个 MySQL 优化工具 AWR,帮你准确定位数据库瓶颈!

    点击上方"方志朋",选择"设为星标" 回复"666"获取新整理的面试文章 来源:今日头条,作者:老王谈运维 www.toutiao.com/ ...

  2. 简单了解SQL性能优化工具MySql Explain

    点击上方蓝色字体,选择"设为星标" 优质文章,及时送达 写在前面 MySql Explain是对SQL进行性能优化不可或缺的工具,通过他我们可以对SQL进行一定的分析和性能优化,降 ...

  3. awr报告分析 mysql_4个MySQL优化工具,帮你准确定位数据库瓶颈!

    作者:老王谈运维原文:https://www.toutiao.com/a6691523026984370699/ 对于正在运行的mysql,性能如何,参数设置的是否合理,账号设置的是否存在安全隐患,你 ...

  4. MySQL:常用的MySQL优化工具

    影响数据库性能的常见因素如下: (1)磁盘IO: (2)网卡流量: (3)服务器硬件: (4)SQL查询速度. 下面介绍几个mysql 优化的工具,可以使用它们对MySQL进行检查,生成awr报告,从 ...

  5. 游戏 mysql优化工具_MySQL 性能优化神器 Explain 使用分析

    extra列返回的描述的意义 Using filesort MySQL有两种方式可以生成有序的结果,通过排序操作或者使用索引,当Extra中出现了Using filesort 说明MySQL使用了后者 ...

  6. 【一】MySql优化概述 + MySql架构与存储引擎

    衡量指标 Qps:Queries Per Second 每秒查询量,同时适用于InnoDB和MyISAM引擎 QUESTIONS/UPTIME Tps:Transactions Per Second ...

  7. MySQL管理工具MySQL Utilities — 如何连接MySQL服务器

    连接参数 连接到一个服务器,必须指定连接参数,如用户名,主机名称,密码,端口号,socket.MySQL Utilities提供了三种提供这些参数的方法,这些方法都需要通过命令行指定. 使用.mylo ...

  8. mysql优化笔记,MySQL优化笔记

    之前安装时没注意MySQL的优化,先想对MySQL做一下优化.首先看一下没有优化之前各个参数:MySQL预编译参数: ./configure --prefix=/usr/local/mysql --w ...

  9. 【Mac】Mac 下安装MySQL优化工具mysqltuner执行报错 [!!] Attempted to use login credentials

    1.背景 (base) lcc@lcc MySQLTuner-perl$ ./mysqltuner.pl --socket /var/lib/mysql/mysql.sock>> MySQ ...

最新文章

  1. OpenCV YUV 与 RGB的互转(草稿)
  2. 扒出了3867篇论文中的3万个基准测试结果,他们发现追求SOTA其实没什么意义
  3. DPDK — 安装部署(CentOS 7)
  4. 又一年度热销爆款,OPPO R11上市一个月勇夺线下销量第一
  5. 计算机视觉与深度学习算法工程师面试题整理
  6. 作用域链(scope chain)和原型链(prototype chain)
  7. oracle 不能导入sql语句,oracle数据库导入.dmp脚本的sql 语句
  8. 让携号转网不再难!但你得了解这几大限制
  9. GitHub 超 3W Star,最受欢迎的 VS Code IDE 是如何炼成的?
  10. Linux Telnet用法详解
  11. Spark入门实战系列--3.Spark编程模型(上)--编程模型及SparkShell实战
  12. 第三季-第13课-无名管道通讯编程
  13. oracle监听防止连接风暴,Oracle Listener 监听风暴处理
  14. 工厂如何引入ERP生产管理系统
  15. 获取深户股市列表api_获取股票api
  16. 住户水电费计算c语言程序,(小区水电费管理系统C语言.doc
  17. html表格上下居中 w3c,HTML中怎么把表格居中
  18. 简单易懂的现代魔法——Play Framework攻略1
  19. 美元用计算机怎么算,美金人民币汇率换算(人民币兑换率计算器)
  20. linux下启动nginx报错libpcre.so.0 = not found

热门文章

  1. Matlab绘制多个折线图的方法
  2. 如何降低研究生硕士论文的查重率
  3. 浏览器访问不了localhost
  4. 数据挖掘之时间序列模型(最全流程分析)
  5. 计算机网络 ip协议是,IP协议是什么
  6. 图论(9)图的连通度
  7. FreeNAS 简介
  8. 免费下载英文文献的网站
  9. 使用Python将文件名中的汉字序号改为阿拉伯数字序号
  10. JSM jQuery插件开源