5 cents hint – MySQL: Set current date and time as Default Value for datetime datatype column?

By | 28. March 2017

If you need to set current date and time as default value then here is the table modification query:

ALTER TABLE mytable MODIFY COLUMN mycolumn datetime DEFAULT CURRENT_TIMESTAMP

Leave a Reply