MySQL DDL and Schema Design Cheatsheet/Modify a column definition

Change type, size, or nullability.

Section: create and alter tables

Modify a column definition

sql
sql
ALTER TABLE users MODIFY COLUMN phone VARCHAR(100) NULL;
Explanation

Use `MODIFY COLUMN` when you are changing the definition but not renaming the column.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing create and alter tables
Add a column
Add a nullable column to an existing table.
OpenIn sheetsqlsame section
Rename a column
Rename a column while specifying its full definition.
OpenIn sheetsqlsame section
Drop a column
Remove a column from a table.
OpenIn sheetsqlsame section
Create a database
Create a schema if it does not already exist.
OpenIn sheetsqlsame section
Create a users table
Create a table with an auto-increment primary key and timestamps.
OpenIn sheetsqlsame section
Rename a table
Rename a table without recreating it.
OpenIn sheetsqlsame section