Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I modify the size of column in a MySQL table?

I have created a table and accidentally put varchar length as 300 instead of 65353. How can I fix that?

An example would be appreciated.

like image 676
vehomzzz Avatar asked Aug 14 '09 18:08

vehomzzz


People also ask

How do you increase the size of a column in a table?

To change the width to a specific measurement, click a cell in the column that you want to resize. On the Layout tab, in the Cell Size group, click in the Table Column Width box, and then specify the options you want.

Which command is to used to modify the size of a column?

The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You should also use the ALTER TABLE command to add and drop various constraints on an existing table.

How do I edit a column in MySQL?

The syntax to modify a column in a table in MySQL (using the ALTER TABLE statement) is: ALTER TABLE table_name MODIFY column_name column_definition [ FIRST | AFTER column_name ]; table_name. The name of the table to modify.


1 Answers

Have you tried this?

ALTER TABLE <table_name> MODIFY <col_name> VARCHAR(65353); 

This will change the col_name's type to VARCHAR(65353)

like image 166
Mike Dinescu Avatar answered Oct 16 '22 12:10

Mike Dinescu