mysql -D dbtest -e "drop tables test01" mysql -D dbtest <test01.sql select * from test01; 5.0.67版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-12 14:15:19 | 2018-01-12 14:15:19 | +---------------------+---------------------+ 5.5.20版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-12 14:15:27 | 2018-01-12 14:15:27 | +---------------------+---------------------+ 5.6.22版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-07 20:13:22 | 2018-01-07 20:13:22 | +---------------------+---------------------+ 5.7.18版本 +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2018-01-07 20:13:20 | 2018-01-07 20:13:20 | +---------------------+---------------------+
(4)ON UPDATE CURRENT_TIMESTAMP属性影响
如果包含ON UPDATE CURRENT_TIMESTAMP属性,则如果对表记录更新,此记录对应的timestamp类型记录也会更新