MySQL TIMESTAMP isn't behaving as advertised I'm using MySQL 5.5.34. The 5.5 Documentation says I can create a table like this:

CREATE TABLE t1 (
  ts1 TIMESTAMP DEFAULT 0,
  ts2 TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    ON UPDATE CURRENT_TIMESTAMP);


From the documentation:


  For t1, ts1 is NOT NULL and assigning it a value of NULL sets it to the current timestamp.


The documentation also says I can only assign CURRENT_TIMESTAMP as the default to a single TIMESTAMP field only. No multiple fields auto updating.

So, I tried this exact trick:

CREATE TABLE `users` (
  blah blah blah,
  `record_created` TIMESTAMP DEFAULT 0,
  `last_updated` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    ON UPDATE CURRENT_TIMESTAMP);


When I execute the CREATE command, I get this back:

ERROR 1067 (42000): Invalid default value for 'record_created'


and the table doesn't actually get created.

What am I missing?
Your mysql server's global configuration don't allow you to insert ZEROS into table column. 
The global configuration parameter SQL_mode is responsible for this behavior. You can find it in your my.ini file if configured or you can also query mysql server to display its value, 

select @@SQL_mode;


It should return you 'STRICT_ALL_TABLES,NO_ZERO_IN_DATE', which needs to be reset by sql command set global SQL_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; or as per your requirement.