MySQL: Out of range value adjusted for column |
2006/02/24 ~ 阿亮 ~ |
最近在 Windows XP 上安裝 CooCooWakka ,
PHP5 + MySQL5.0.13 + CooCooWakka0.0.9rc3 + Apache2.0.55
安裝過程,發現有下面的的訊息,
Query failed: insert into wakka_pages set tag = ‘MyNoteBook?’, time = now(), owner = , category = , user = ‘127.0.0.1’, latest = ‘Y’, body = ‘test’, tinychange= ‘N’, note= ,isnew= ‘Y’,aliasname= ,tview_count= ,refer_count= ; (Field ‘body_r’ doesn’t have a default value)
所以,去 MySQL 設定欄位 body_r 預設可以為 NULL,但接下來就發生下列的訊息,
Query failed: insert into wakka_pages set tag = ‘MyNoteBook?’, time = now(), owner = , category = , user = ‘127.0.0.1’, latest = ‘Y’, body = ‘test’, tinychange= ‘N’, note= ,isnew= ‘Y’,aliasname= ,tview_count= ,refer_count= ; (Out of range value adjusted for column ‘tview_count’ at row 1
後來查到說 mysql5 不喜歡空值 ”,而另外網頁則說明在「配置數據庫的時候設定為限制傳統 sql 格式了」,所以,在設定 MySQL Instance 時,將預設的 Strict Mode 的選項去除,再重新安裝 CooCooWakka 即可。