The first time you encounter a problem, you have to keep a diary
MySQL error prompt:
SQLSTATE[HY000]: General error: 1364 Field ‘xxxxx’ doesn’t have a default value
This report is translated as follows:
The details field has no default value; That is to say, we have not assigned a value to it, and there is no default value set for this field in the table. This is something that was created after MySQL 5 came out. Take a serious look at my.ini file
I used the pagoda to check the following MySQL configuration:
#This paragraph
sql-model=NO_ ENGINE_ SUBSTITUTION,STRICT_ TRANS_ TABLES
Take a look at No_ ENGINE_ Division official explanation:
When using alter table
or create table
to specify engine, the required storage engine is disabled or not compiled. What should be done. Enable no_ ENGINE_ When substitution
, the error will be thrown directly; When this value is not set, create is replaced by the default storage engine, atler does not change and throws a warning
Take another look at strict_ TRANS_ Official explanation of tables:
Indicates that strict mode is enabled
Look again: No_ AUTO_ CREATE_ USER
Grant is not allowed to create users with empty password
Baidu solved the problem in a circle. If you forget what you found, you can write a record by yourself. The reason for the problem is that MySQL uses strict verification method
Solution: directly change the SQL model mode to the following figure:
sql-mode=NO_ AUTO_ CREATE_ USER,NO_ ENGINE_ SUBSTITUTION
Similar Posts:
- incorrect integer value for column [How to Solve]
- Solve the problem of grouping error expression #1 of select list is not in group for MySQL greater than version 5.7
- Expression #1 of ORDER BY clause is not in SELECT list, references column ‘xxxx’ which is not in SELECT list; this is incompatible with DISTINCT
- [Solved] MYSQL Command gruop by Error: this is incompatible with sql_mode=only_full_group_by
- When mysql creates a table, set timestamp DEFAULT NULL error 1067-Invalid default value for’updated_at’
- Laravel uses group by to report errors [How to Solve]
- SELECT list is not in GROUP BY clause and contains nonaggregated
- [Solved] MYSQL8 group by Error: Cause: java.sql.SQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY
- [Solved] SELECT list is not in GROUP BY clause and contains nonaggregated
- [Solved] MySQL Error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre