How do you set a default value for a MySQL Datetime column?
In SQL Server it\'s getdate(). What is the equivalant for MySQL? I\'m using MySQL 5.x if tha
getdate()
If you have already created the table then you can use
To change default value to current date time
ALTER TABLE CHANGE COLUMN DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
To change default value to '2015-05-11 13:01:01'
ALTER TABLE CHANGE COLUMN DATETIME NOT NULL DEFAULT '2015-05-11 13:01:01';