
mysql error 1364 Field doesn't have a default values的解決方法
進入mysql終端執行下面命令
SHOW VARIABLES LIKE 'sql_mode';
如果啓用了嚴格模式就會顯示如下信息
1
2
3
4
5
6
7
mysql> SHOW VARIABLES LIKE 'sql_mode';
+---------------+--------------------------------------------+
| Variable_name | Value |
+---------------+--------------------------------------------+
| sql_mode | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+---------------+--------------------------------------------+
1 row in set (0.00 sec)
關閉mysql嚴格模式
SET GLOBAL sql_mode='';
當然建議使用以下方式比較安全
1
2
3
4
5
6
7
打開Mysql終端並登錄
Run mysql console:
mysql -u your_username -p
選擇你的數據庫
USE your_database;
執行下面命令關閉mysql的嚴格模式
SET GLOBAL sql_mode='';
💘 相关文章
- Starting MySQL... ERROR! ……quit without updating PID file (/opt/mysql/data/mysql.pid)解決方法
- MySQL在Mac系統通過brew安裝以及重啟的方法
- rclone error listing directory not found的解决方法
- Yarn install command error No such file or directory: 'install'的解决方法
- php Parse error: syntax error, unexpected ';', expecting ',' or ')'的解决方法
- nginx: [warn] "ssl_stapling" ignored, not supported error
- mysql database connection failed | SQLSTATE[HY000] [2002] Connection refused solution
- Tetua-Open source lightweight cms program configuration github login tutorial based on golang and mysql
- MySQL remote connection configuration method under docker container
- 一款强大的开源国产图床系统,基于PHP,MySQL