Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

2017-07-28T12:46:35.138596Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

In fact, this error was already reported during the initialization of the installation (you can see it in the first installation article), but it did not affect the installation and startup, so there was no control, thinking that it was just checking the class error during installation. Later, when restarting mysql, it was found that this error would also appear in the error log.

Solution:

Find this passage on the official website of 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:

This means that there is such a check after 5.6. so the standard explicit_defaults_for_timestamp function is turned on, but it is turned off by default.

Add to my.cnf

[mysqld]

Explicit_defaults_for_timestamp=true

If you still report an error, execute the following mysql startup command as prompted by mysql:

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report