mysql - MySQL 5.0 上的 pt-online-schema-change Percona 命令问题

标签 mysql percona

我们仍在使用 MySQL 5.0,并且刚刚了解到我们的系统上有一个名为 Percona 的工具。我们收到了一个命令来帮助我们确定在数据库上执行 alter 语句需要多长时间,因为我们遇到了“长时间运行查询”的情况,并且它阻碍了数据库正常启动。我的问题是,我们是否可以在 MySQL 5.0 上执行以下 Percona 命令,因为我们也收到以下错误?

这是命令:

pt-online-schema-change --set-vars innodb_lock_wait_ti
meout=50 --host=localhost   --alter-foreign-keys-method=auto user=tfuser --ask
-pass --alter " ADD INDEX indAppPostCodeAnywhere (Forename, Surname, DOB, Applic
ationDate)" D=DBName,t=Application  --dry-run

这是错误:

Usage: pt-online-schema-change [OPTIONS] DSN

Errors in command-line arguments:
  * Specify only one DSN on the command line
  * The DSN must specify a database (D) and a table (t)

pt-online-schema-change alters a table's structure without blocking reads or
writes.  Specify the database and table in the DSN.  Do not use this tool before
reading its documentation and checking your backups carefully.  For more
details, please use the --help option, or try 'perldoc
/usr/bin/pt-online-schema-change' for complete documentation.

任何帮助/指导将不胜感激。谢谢。

最佳答案

我显然遇到了语法问题。这是修改后的命令,以防其他人遇到同样的问题:

pt-online-schema-change D=DBName,t=Application,h=localhost,u=tfuser --alter="ADD INDEX indAppPostCodeAnywhere (Forename, Surname, DOB, ApplicationDate)" --alter-foreign-keys-method="auto" --ask-pass --dry-run --set-vars="innodb_lock_wait_timeout=50"

谢谢

关于mysql - MySQL 5.0 上的 pt-online-schema-change Percona 命令问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25763838/

相关文章:

mysql - percona 时间戳默认 0 不为空

mysql - 在主键以外的字段上加入另一个表

mysql - 以下主键更改适用于 `pt-online-schema-change` 吗?

mysql - Percona MySQL Server 5.7.23 是否支持多源复制?

mysql - Percona 工具包对比Openark 套件。架构变更

MySQL 用 Dateranges 计算两个表

mysql - WHERE value IS NOT IN(子查询)

php - 检查订阅是否已过期

MySQL 字符串模式匹配 - 类似的替代方法

mysql - 亚马逊 Linux ami 上的 Percona 5.6 失败