前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >mysql调优工具

mysql调优工具

作者头像
保持热爱奔赴山海
发布2019-09-18 11:22:12
1K0
发布2019-09-18 11:22:12
举报
文章被收录于专栏:数据库相关

下载地址:

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

直接使用

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

下载即可。

chmod +x mysqltuner.pl

./mysqltuner.pl 然后输入用户名和密码即可。

下图是我一台线上服务器的检测结果。

wKioL1gqcdmzJ3xkAACHLnEzXTQ198.png
wKioL1gqcdmzJ3xkAACHLnEzXTQ198.png

浏览输出的结果,特别是末尾的 Recommendations ,里面一般会提到您需要在 my.cnf 修改的内容。修改 my.cnf 后记得重启 MySQL 。重启后再运行 MySQLTuner 检查。

另外需要注意的是 MySQL 需要启动 24 小时候再运行 MySQLTuner ,不然有些内容会不准。

另外,./mysqltuner.pl --help 能显示支持哪些参数。【从下面的参数可以发现这个工具还支持远程主机的体检】

   Connection and Authentication

      --host <hostname>    Connect to a remote host to perform tests (default: localhost)

      --socket <socket>    Use a different socket for a local connection

      --port <port>        Port to use for connection (default: 3306)

      --user <username>    Username to use for authentication

      --pass <password>    Password to use for authentication

      --defaults-file <path>  Path to a custom .my.cnf

      --mysqladmin <path>  Path to a custom mysqladmin executable

      --mysqlcmd <path>    Path to a custom mysql executable

      --noask              Don't ask password if needed

   Performance and Reporting Options

      --skipsize           Don't enumerate tables and their types/sizes (default: on)

                           (Recommended for servers with many tables)

      --skippassword       Don't perform checks on user passwords(default: off)

      --checkversion       Check for updates to MySQLTuner (default: don't check)

      --updateversion      Check for updates to MySQLTuner and update when newer version is available (default: don't check)

      --forcemem <size>    Amount of RAM installed in megabytes

      --forceswap <size>   Amount of swap memory configured in megabytes

      --passwordfile <path>Path to a password file list(one password by line)

   Output Options:

      --silent             Don't output anything on screen

      --nogood             Remove OK responses

      --nobad              Remove negative/suggestion responses

      --noinfo             Remove informational responses

      --debug              Print debug information

      --dbstat             Print database information

      --idxstat            Print index information

      --sysstat            Print system information

      --pfstat             Print Performance schema information

      --bannedports        Ports banned separated by comma(,)

      --maxportallowed     Number of ports opened allowed on this hosts

      --cvefile            CVE File for vulnerability checks

      --nocolor            Don't print output in color

      --json               Print result as JSON string

      --prettyjson         Print result as human readable JSON

      --buffers            Print global and per-thread buffer values

      --outputfile <path>  Path to a output txt file

      --reportfile <path>  Path to a report txt file

      --template   <path>  Path to a template file

      --verbose            Prints out all options (default: no verbose)

例如我有1台服务器,上面跑的是多实例的mysql上面,体检的话,需要使用

./mysqltuner.pl --socket /data/multi_instance/3306/mysql.sock

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016/11/15 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档