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)解決方法
- Error(128): Key has been revoked trying to mount.cifs的解决方法
- mysql数据存储路径修改
- 一次mysql安装的折腾记录解决方法
- 轻量级的Php mysql web 管理客户端程序Adminer
- Yarn install command error No such file or directory: 'install'的解决方法
- mysql database connection failed | SQLSTATE[HY000] [2002] Connection refused solution
- pve error before or during data restore, some or all disks were not completely restored的解决方法
- PicGo配置兼容亚马逊s3的digitalocean space出現Error Stack Begin的解決方法
- rclone error listing directory not found的解决方法