天天看點

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

    其實這個報錯在安裝的初始化的時候就已經有了(在第一篇安裝的文章中能看到),隻不過沒有影響安裝和啟動,是以并沒有管,以為隻是安裝的時候檢查類的報錯,後來在重新開機mysql發現在error日志裡面也會出現這個報錯

解決方法:

在mysql官方網站上找到這麼一段話

Those nonstandard behaviors remain the default for TIMESTAMP but as of MySQL 5.6.6 are deprecated and this warning appears at startup:

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

Please use --explicit_defaults_for_timestamp server option (see

documentation for more details).

As indicated by the warning, to turn off the nonstandard behaviors, 

enable the new explicit_defaults_for_timestamp system variable at server startup. 

With this variable enabled, the server handles TIMESTAMP as follows instead:

這段話的意思是在5.6以後有這麼一項檢查,是以要開啟标準的 explicit_defaults_for_timestamp功能,但是預設是關閉的。

在my.cnf中加入

[mysqld]

explicit_defaults_for_timestamp=true

如果還是報錯,按mysql提示的執行下面的mysql啟動指令:

./bin/mysqld_safe --user=mysql --explicit_defaults_for_timestamp=1 &

本文轉自 yuri_cto 51CTO部落格,原文連結:http://blog.51cto.com/laobaiv1/1951798,如需轉載請自行聯系原作者

繼續閱讀