How do I use pt-online-schema-change on AWS RDS instance?

I am hoping to be able to use pt-online-schema-change to add a column to a live database.

The database in question is an AWS mySql RDS instance (Not MySQL installed on an EC2 instance) and not Aurora).

I can see other posts about people using this tool on an RDS instance, but no one actually says how they do it?

Using a mysql SQL command line tool I send:

pt-online-schema-change --dry-run --alter ‘ADD COLUMN cleaned TINYINT DEFAULT 0’ D=usage_stats,t=live_api_calls;

and I get “You have an error in your SQL” error message…

So it does not appear to be installed. How do I install it since we don’t have SSH access to the “server” for an RDS instance.?

Or is is installed and I need some other syntax to run the command?

Hi @ianbale.
Welcome the Percona Forum.

You need to execute pt-osc from a Linux command line; you would need to install the Percona Toolkit and execute it from a server that has communication to your RDS instance, and point it with the proper options (See Docs ), something like this:

pt-online-schema-change --dry-run --alter ‘ADD COLUMN cleaned TINYINT DEFAULT 0’ h=YOUR_IP/ENDPOINT D=usage_stats,t=live_api_calls;

Give it a try.

1 Like

Ah!

So I install the toolkit locally, not on the RDS instance…

Right. Will give that a go on Monday.

Thank you!

2 Likes