centos下lamp已经安装成功
用magento的检验程序检验环境,提示成功
但是我在安装magento的时候,在设置了数据库信息后,过一段时间出现如下错误:
There has been an error processing your request
rror in file: "/usr/local/apache2/htdocs/magento/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' Trace: #0 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...') #1 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0', '1.6.0.1') #2 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0', '1.6.0.1') #3 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates() #4 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/App.php(412): Mage_Core_Model_Resource_Setup::applyAllUpdates() #5 /usr/local/apache2/htdocs/magento/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules() #6 /usr/local/apache2/htdocs/magento/app/Mage.php(640): Mage_Core_Model_App->run(Array) #7 /usr/local/apache2/htdocs/magento/index.php(80): Mage::run('', 'store') #8 {main}
解决:
把表coupon_aggregated的period字段的默认值设置为“0000-00-00”,
可以通过mysql客户端修改,也可以通过命令行:
alter table coupon_aggregated change period period DATE not null DEFAULT '0000-00-00';