1. 程式人生 > >關於資料庫5.5與5.6版本區別

關於資料庫5.5與5.6版本區別

MYSQL5.5與MYSQL5.6版本之間對於timestamp處理區別:在MySQL 5.5文件有這麼一段話:One TIMESTAMP column in a table can have the current timestamp as the default value for initializing the column, as the auto-update value, or both. It is not possible to have the current timestamp be the default value for one column and the auto-update value for another column.而在MySQL 5.6.5做出了以下改變:Previously, at most one TIMESTAMP column per table could be automatically initialized or updated to the current date and time. This restriction has been lifted. Any TIMESTAMP column definition can have any combination of DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses. In addition, these clauses now can be used with DATETIME column definitions. For more information, see Automatic Initialization and Updating for TIMESTAMP and DATETIME.可以使用觸發器來替代一下,或者是更換資料庫版本!