简介:pt-variable-advisor用途是用来分析配置参数,并提出相应的配置建议。
--ask-pass Prompt for a password when connecting to MySQL 链接mysql时提示输入密码
--charset=s -A Default character set 默认字符集
--config=A Read this comma-separated list of config files; if specified, this must be the first option on the command line 阅读这个以逗号分隔的配置文件列表; 如果指定,这必须是第一个选项命令行
--daemonize Fork to the background and detach from the shell
--database=s -D Connect to this database
--defaults-file=s -F Only read mysql options from the given file 仅从给定文件中读取mysql选项
--help Show help and exit
--host=s -h Connect to host
--ignore-rules=h Ignore these rule IDs
--password=s -p Password to use when connecting
--pid=s Create the given PID file 创建给定的pid文件
--port=i -P Port number to use for connection
--set-vars=A Set the MySQL variables in this comma-separated list of variable=value pairs
在此逗号分隔列表中设置MySQL变量变量=值对
--socket=s -S Socket file to use for connection
--source-of-variables=s Read SHOW VARIABLES from this source (default mysql)
从这个源读取SHOW VARIABLES(默认mysql)
--user=s -u User for login if not current user
--verbose -v Increase verbosity of output (default 1) 增加输出的详细程度(默认值为1)
--version Show version and exit
--[no]version-check Check for the latest version of Percona Toolkit,MySQL, and other programs (default yes)
检查Percona Toolkit,MySQL和其他程序的最新版本(默认是)
使用方法用例:
# 首先查询当前配置写入到指定文件
mysql -uroot -p -e "show global variables">/home/vars.txt
pt-variable-advisor --source-of-variables vars.txt
pt-variable-advisor是一款用于分析MySQL配置参数并提供优化建议的工具。它支持多种操作,如连接到特定数据库、设置字符集、读取配置文件、后台运行等。本文将介绍如何使用该工具查询当前配置并生成配置建议。
331

被折叠的 条评论
为什么被折叠?



