Change MySQL Column Length

To change the field length of a MySQL table, you can use the ALTER TABLE statement.

The grammar is as follows:

ALTER TABLE table_name MODIFY COLUMN column_name data_type(length);

In this case, table_name is the name of the table to be modified, column_name is the name of the field to be modified, data_type is the data type of the field, and length is the new length of the field.

For example, suppose there is a table named customers with a field named email, which has a data type of VARCHAR(50). Now, to modify its length to VARCHAR(100), you can use the following statement:

ALTER TABLE customers MODIFY COLUMN email VARCHAR(100);
bannerAds