How to do it...

Modifying the column data type can be done as follows:

shell> pt-online-schema-change D=employees,t=employees,h=localhost -u root --ask-pass --alter="MODIFY COLUMN address VARCHAR(100)" --alter-foreign-keys-method=auto --executeEnter MySQL password: No slaves found.  See --recursion-method if host server1 has slaves.Not checking slave lag because no slaves were found and --check-slave-lag was not specified.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, 1Child tables:  `employees`.`dept_emp` (approx. 331143 rows)  `employees`.`titles` (approx. 442605 rows)  `employees`.`salaries` (approx. 2838426 rows) `employees`.`dept_manager` ...

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.