I have a status column in my database table. Type : tinyint(4) and the Default value is 0. I want to change the default value to 1. How to do that? May be this is a very simple question, but I don't know.
5 Answers
You can do so
ALTER TABLE `table_name` CHANGE `column_name` `column_name` TINYINT(4) DEFAULT 1 NOT NULL;
2 Comments
Strawberry
I've explained above.
Robert
Looks like in phpMyAdmin there is not this possiblity
Try this
ALTER TABLE `Type` CHANGE `status` `status` tinyint(4) NOT NULL DEFAULT 1
1 Comment
strix25
why is '1' in quotes ?
ALTER TABLE `your_table` CHANGE `your_column` `your_column` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '1'
1 Comment
strix25
why '1' in quotes?