mvasco
mvasco

Reputation: 5107

Incorrect datetime value in MySQL table

I have just created a new MySQL in an AWS Ubuntu instance.

Then I have copied a table from another MySQL server to the new created database.

This is the structure from some fields from one of the tables:

enter image description here

My issue is that every time I try to enter a new record on the table, there is an error at field fecha_recepcion_disp:

enter image description here

I have checked if the original table from where I have copied the table has the same issue, but no, I am able to enter a new record without issues.

What should I check in the new database or table in order to avoid the issue?

EDIT:

The only difference between both servers is that the first one is located in the USA and the second one is located in France.

Upvotes: 1

Views: 507

Answers (2)

mvasco
mvasco

Reputation: 5107

Issue solved:

The new server had value NO_ZERO_DATE in sql mode variable.

Upvotes: 3

Alexandre Elshobokshy
Alexandre Elshobokshy

Reputation: 10922

You're surely using different versions. MySQL 5.7+ stopped supporting zero values in the datetime field.

You can either use as default the current timestamp, or put null.

Upvotes: 2

Related Questions