MySQL Rename column

MySQL Rename column

Rename MySQL column using alter table syntax and change keyword.

MySQL Rename column syntax

ALTER TABLE table_name CHANGE OLD_column_name new_column_name;

Rename column example

ALTER TABLE `books` CHANGE `stock` `in_stock` VARCHAR(2);

Output

table `books` altered.