title: MySQL two column timestamp default NOW value ERROR 1067
body: <p>I have table as shown below. In order to workaround one default <em>now</em> column restriction of MySQL I used the tip as shown <a href="http://gusiev.com/2009/04/update-and-create-timestamps-with-mysql/" rel="nofollow noreferrer">here</a> </p>
  
  <pre><code>CREATE  TABLE IF NOT EXISTS mytable (
    id INT NOT NULL AUTO_INCREMENT ,
    create_date TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00' ,
    update_date TIMESTAMP NULL DEFAULT NOW() ON UPDATE NOW() ,
    PRIMARY KEY (`parti_id`) )
  ENGINE = InnoDB;
  </code></pre>
  
  <p>My sql_mode does not include <code>NO_ZERO_DATE</code> as pointed <a href="http://www.ispirer.com/wiki/sqlways/troubleshooting-guide/mysql/import/zero-date-not-accepted" rel="nofollow noreferrer">here</a> my output :</p>
  
  <pre><code>mysql&gt; SELECT @@sql_mode;
  +------------+
  | @@sql_mode |
  +------------+
  |            | 
  +------------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <p>It is still giving the error as shown below:</p>
  
  <pre><code>ERROR 1067 (42000) at line xx in file: '/myschema.sql': Invalid default value for 'create_date'
  </code></pre>
  
  <p>I use MySQL 5.1.37 on Ubuntu</p>
  
  <p>How can I fix it? Thanks.</p>