Cannot use datetime type in mysql workbench

I tried to create a column using datetime type in MySQL workbench.
but when I select the datetime type, an error occurs, for example,

Failed to set new data type. This DATETIME data type contains errors and cannot be accepted. The previous value is saved instead.

How can i use this type?

+5
source share
2 answers

I had this problem, you need to make sure that when choosing the data type you change the date and time () to datetime using no ().

From MySQL 5.6.4 onwards, DATETIME can have sub-segments, the level of accuracy is defined in (), if you do not use sub-seconds, then just delete it all together. This also applies to the TIME and TIMESTAMP data types.

See here for more details.

+14
source

Restore the original desktop connection or reset additional connection properties to update the server version. If the server has been updated and the work connection has not been updated, the workstation still thinks it is working with the old version and therefore limits and puts datetime (x) as an error.

0
source

Source: https://habr.com/ru/post/1245292/


All Articles