mysql> insert into t1 values (-129), (-128), (127),(128);
ERROR 1264 (22003): Out of range value for column 'x' at row 1

 

原因:

新版本的MySQL对字段的严格检查

 

解决

把my.cnf中的

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

改为

sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 

重新启动MySQL。
以后写sql语句时,类型和值最好严格一些

相关文章:

  • 2022-12-23
  • 2022-02-04
  • 2021-09-13
  • 2021-11-07
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2021-06-30
  • 2021-08-30
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
相关资源
相似解决方案