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()
Here is how to do it on MySQL 5.1:
ALTER TABLE `table_name` CHANGE `column_name` `column_name` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
I have no clue why you have to enter the column name twice.