1. 程式人生 > 資料庫 >mysql5.5 check the manual that corresponds to your MySQL server version for the right syntax

mysql5.5 check the manual that corresponds to your MySQL server version for the right syntax

最近在做javaweb大作業的時候,給資料庫整慘了。
在匯入資料時,還有建表時,老是提示check the manual that corresponds to your MySQL server version for the right syntax.
找了好久,最後發現是mysql5.5不支援datetime設定長度。
顯示資料庫語句有語法錯誤,經過檢查,為mysql版本過低,不能對TIME、TIMESTAMP及DATETIME等型別指定長度,在低於mysql5.6.4版本以下給TIMESTAMP,DATETIME型別指定長度,不支援!升級資料庫版本後,問題解決。

5.6.4以後時間型別(TIME,DATETIME,TIMESTAMP)支援微秒

DATETIME範圍 :‘1000-01-01 00:00:00.000000’ to ‘9999-12-31 23:59:59.999999’

TIMESTAMP範圍: values is ‘1970-01-01 00:00:01.000000’ to’2038-01-19 03:14:07.999999’

在這裡插入圖片描述
把長度去掉以後:
在這裡插入圖片描述