Thursday 5 April 2012

Magento 1.6.2.0 Syntax error or access violation: 1067 Invalid default value for ‘period‘

When I am trying to install magento 1.6.2.0 I getting error in app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'period'. after long time I finding solution for that. Just fire below query in your database and continue setup just remove error link from url. I hope it work for you.
ALTER TABLE `coupon_aggregated` CHANGE COLUMN `period` `period` DATE NOT NULL DEFAULT ‘0000-00-00’