Answers for "default a date column with current date in mysql"

SQL
3

set default today mysql

ALTER TABLE table
ADD column DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
Posted by: Guest on April-08-2021
0

mysql update column default value CURRENT_TIMESTAMP error

# Best case you can do is drop the column and recreate it with the set timestamp;
ALTER TABLE `TABLE_NAME` DROP COLUMN `COLUMN_NAME`;
ALTER TABLE `TABLE_NAME` ADD COLUMN `COLUMN_NAME` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
Posted by: Guest on October-26-2021

Code answers related to "default a date column with current date in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language