How can we modify column/s of MySQL table?

MySQLMySQLi Database

By using MODIFY keyword with ALTER TABLE command we can modify the column/s of MySQL table. The syntax for the same is as follows;


Alter table table_name MODIFY column_name1 datatype, MODIFY column_name2 datatype… MODIFY column_nameN datatype);


In the example below, with the help of MODIFY keyword in ALTER Command, the size of column ‘Address’ and ‘Grade’ has been modified.

mysql> Alter table student modify address varchar(45),Modify Grade Varchar(15);
Query OK, 5 rows affected (0.38 sec)
Records: 5 Duplicates: 0 Warnings: 0
Published on 19-Feb-2018 12:57:34