When adding fields to a table, I suddenly find that the default value of a field of date type is wrong, which is depressing~
After troubleshooting, it turns out that there is a problem with MySQL configuration. Under Wamp, SQL is not set in MySQL 5.7_ Mode.
1. Find [mysqld] in my.ini file
2. If there is no SQL_Mode, add it and modify it if necessary
sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
or
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
3.Restart MySQL;
use the following commands to operate mysql:
systemctl restart mysqld.service
systemctl start mysqld.service
systemctl stop mysqld.service
Read More:
- [Solved] MySQL5.6.44 [Err] 1067 – Invalid default value for create_date settlement programme
- How to Solve mysql [Err] 1067-Invalid default value for
- [Solved]ERROR 1067 (42000): Invalid default value for ‘end_time‘ Mysql
- MYSQL Create TIMESTAMP and Save Error: ERROR 1067 (42000): Invalid default value for ‘last_updated_on’
- [MySQL] mysql 5.5 and 5.6 timestamp default default value CURRENT_TIMESTAMP problem
- mysql workbench Error Code: 1046. No database selected Select the default DB to be used by doubl
- Mysql :error 1111. Invalid use of group function
- [Solved] MySQL: Syntax error or access violation: 1055 Expression #1 of SELECT list is not …
- [Solved] MySQL: datetime (0) null default NULL
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- Mysql Flashback Warning: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe
- How to Solve MySQL version 5.7+ Group by group error
- MYSQL gruop by Error: this is incompatible with sql_mode=only_full_group_by
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] MYSQL Start Project Error: this is incompatible with sql_mode=only_full_group_by
- Idea connect mysql error Server returns invalid timezone. Go to’Advanced’ tab and set’serverTimezone’ property
- [Solved] MySQL Error: “Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’