easy mysql question
Moderator: General Moderators
easy mysql question
i have a database table, one of the columns is set to CHAR(20)... how do i change it to CHAR(30) using the mysql command line?
try this
Code: Select all
ALTER TABLE `table_name` CHANGE `field_name` `field_name` INT( 30 ) NOT NULL AUTO_INCREMENT
sorry...i tested it on one of my databases first the field i tested it on had an auto increment...did you add the autoincrement to it as well...ill help you remove it if so
would work just fine
Code: Select all
ALTER TABLE `table_name` CHANGE `field_name` `field_name` VARCHAR( 30 )