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
For all those who lost heart trying to set a default DATETIME value in MySQL, I know exactly how you feel/felt. So here is is:
ALTER TABLE `table_name` CHANGE `column_name` DATETIME NOT NULL DEFAULT 0
Carefully observe that I haven't added single quotes/double quotes around the 0
I'm literally jumping after solving this one :D