How to modify the default value of a column in MySQL: directly execute the [alter table table name alter column field name set default default value;] statement to modify the default value.

If there is a default value, delete it first
(recommended tutorial:mysql video tutorial)
alter table表名alter column字段名drop default;
Then set the default value (if it does not exist, you can set it directly)
alter table表名 alter column字段名 set default默认值;
Related recommendations:mysql tutorial
The above is the detailed content of How to modify the default value of a column in mysql. For more information, please follow other related articles on the PHP Chinese website!