Percona pt在线模式更改无法更改表

问题描述 投票:0回答:1

我正在尝试使用pt-online-schema-change更改表中的数据大小。我正在尝试将name列增加到varchar(30)

pt-online-schema-change D=clients,t=client_types --alter "CHANGE `name` `name` varchar(30)" --dry-run;

我遇到一些错误。

-bash: name: command not found

然后似乎该命令已执行,但最终失败。

Operation, tries, wait:
analyze_table, 10, 1
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_foreign_keys, 10, 1
Starting a dry run.  `clients`.`client_types` will not be altered.  Specify --execute instead of --dry-run to alter the table.
Creating new table...
Created new table clients._client_types_new OK.
Altering new table...
2019-10-08T13:43:40 Dropping new table...
2019-10-08T13:43:40 Dropped new table OK.
Dry run complete.  `clients`.`client_types` was not altered.
Error altering new table `clients`.`_client_types_new`: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(30)' at line 1 [for Statement "ALTER TABLE `clients`.`_client_types_new` CHANGE   varchar(30)"] at /usr/bin/pt-online-schema-change line 9194.

我正在使用mysql Ver 14.14

mysql percona
1个回答
0
投票

这解决了我的问题。 pt-online-schema-change --dry-run --alter "modify name varchar(30)" D=client,t=client_types;

© www.soinside.com 2019 - 2024. All rights reserved.