MySQL – Increase Column Size
Did you create a column with a specific size and would you like increase it now? In this MySQL Tutorial, we shall learn how to modify the size of a column in MySQL Table.
To change column size use ALTER TABLE query as shown below:
</>
Copy
ALTER TABLE table_name MODIFY column_name datatype
Example to change column size in MySQL Table
Let us consider students
table with the following schema.
The name
column is of datatype varchar
and size 5
.
To increase the size of the column, we shall run the following SQL Query.
</>
Copy
ALTER TABLE students MODIFY name VARCHAR(30);
Now, let us see the modified schema if the column size has updated.
The column size has been successfully updated to the new value.