我们仍然在使用Percona5.0,并且刚刚得知我们的系统上有一个名为MySQL的工具。当我们遇到“长时间运行的查询”的情况时,我们得到了一个命令来帮助我们确定在数据库上执行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.任何帮助/指导都将不胜感激。谢谢。
发布于 2014-09-11 05:08:15
我显然有一个语法问题。以下是修改后的命令,以防其他人遇到同样的问题:
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"谢谢
https://stackoverflow.com/questions/25763838
复制相似问题