0

I need to able to add an index to a column in a MySQL table. I am using Mysql Ver 14.12 Distrib 5.0.77 and Percona-Toolkit 2.0.3. I can add the index using the Percona-Toolkit using:

pt-online-schema-change --alter "ADD INDEX server (server) USING BTREE" h=host1,D=customer,t=test_percona_restructure,u=user,p=password

This works fine on host1. The issue is that this change is not replicated over to host2 and host3 which is not desirable. Running the above on the other two instances will break replication in the environment.

Is there a way that the above can be achieved and in real time and replicated across to host 2 and 3? From the documentation, I see that pt-table-sync sounds like it could be close but sounds like you need to complete the schema change and then sync which is bad for me.

Any help would be great.

sudodashell
  • 121
  • 4
  • 12
  • Do you need `--slave-user`? – Rick James Apr 09 '18 at 17:21
  • I don't think --slave-user and --slave-pasword are available in Percona-Toolkit 2.0.3, see below output: ```]# pt-online-schema-change --alter "ADD INDEX httpPort (httpPort) USING BTREE" h=host1t,D=customer,t=test_percona_restructure,u=user,p=passwd --slave-user=anotherUser --slave-password=AnotherPasswd Unknown option: slave-user Unknown option: slave-password Usage: pt-online-schema-change [OPTION...] DSN Errors in command-line arguments: * Error parsing options ``` Unless the options need to be specified in another location....? – sudodashell Apr 10 '18 at 09:36

0 Answers0