php網(wǎng)站制作中經(jīng)常遇到 Field 'id' doesn't have a default value MYSQL經(jīng)常遇到這樣的錯誤
改如何解決呢
解決方法如下:
Field 'id' doesn't have a default value問題解決方法
MySQL 5中,出現(xiàn)錯誤提示:
Field 'id' doesn't have a default value
解決方法一:
打開my.ini,查找
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
修改為
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
然后重啟MYSQL
解決方法二:
MySQL 5 uses a strict mode which needs to be disabled.
In Windows, Goto Start-->Programs-->MySQL->MySQL Instance Config Wizard. Follow through the Reconfigure Instance option-->Detailed Configuration-->Continue Next a few screens. At the bottom under Enable TCP/IP option there is 'Enable Strict Mode'. Deslect this option (no tick). Save changes and MySQL will restart