Set current date as default for date Type in mysql
I have to add new columns in table 'order' namely shippedDate and last_updated which consist of datetime data type. i would like to do the following. a) Set shippedDate defaults value to MySQL NOW() or CURRENT_DATE b) Set last_updated default value to CURRENT_TIMESTAMP Instead of null which it uses by default. as the table already exist and it already some existing records i would like to do Modify table, i tried using two different code but none is working. ALTER TABLE orders ADD COLUMN shippedDate Date NULL default CURRENT_DATE AFTER 'previoueColumn' , ADD COLUMN ` last_updated ` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP AFTER ` shippedDate ` ; It gives me Error :Error 1067 : Invalid default value for shippedDate. is it possible for me to set the default datetime value to NOW() in MySQL? thank you...