How to increase the length of a column with char
data type in mysql
?
The following query
ALTER TABLE tablename ALTER COLUMN columnname varchar(30) not null;
is not working.
Point out my error please. Thanks
ALTER TABLE `tablename` CHANGE `columnname` `columnname` VARCHAR( 30 ) NOT NULL
OR
ALTER TABLE `tablename` MODIFY `columnname` VARCHAR( 30 ) NOT NULL
please try query given below
ALTER TABLE tablename MODIFY columnname varchar(30) NOT NULL;
You can refer to this tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With