P
P
prrrrrrr2019-11-12 10:00:57
CMS
prrrrrrr, 2019-11-12 10:00:57

Why is SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value thrown?

I'm trying to install Shopware CMS, but the following error pops up during installation:

Error
Received the following error message:
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'password_change_date'

Please try to fix this error and restart the update.
Response
{"query":
"CREATE TABLE `s_user` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n ..............  KEY `default_shipping_address_id`
(`default_shipping_address_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci",
"success":false,
"offset":2300,
"errorMsg":"SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'password_change_date'"}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan., 2019-11-12
@prrrrrrr

Syntax error or access violation: 1067 Invalid default value for 'password_change_date
Look at the description of the password_change_date field in the generated table, you may have specified a
default value that is not compatible with the data type of this field.

D
Denis, 2019-11-12
@sidni

The error indicates that there is no default value for the field in the table, and the query does not have a value for this field.
There are two possible solutions to change the table and add a default value for the field, let's say NULL, if this error will be repeated with other fields, it is necessary to add the NO_ZERO_IN_DATE and NO_ZERO_DATE mods to the database.
You may need other mods to disable strict mode in mysql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question