您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

解决MySQL 5.0不能使用自动增加字段问题

2024/3/26 12:50:05发布21次查看
具体原因: 引起的原因是在mysql5.0.2版本中的the server sql mode 中新加了几种 sql_mode,并且在sql的my.ini文件中的sql-mode 默认增加了其中的二种,一个是strict_trans_tables,就是导致auto_increament失败的mode,这个sql_mode主要用于 当一个值不能插入到
具体原因:
引起的原因是在mysql5.0.2版本中的the server sql mode 中新加了几种 sql_mode,并且在sql的my.ini文件中的sql-mode 默认增加了其中的二种,一个是strict_trans_tables,就是导致auto_increament失败的mode,这个sql_mode主要用于 当一个值不能插入到表中是,则产生一个错误而不是一个警告并终止会话。
解决办法:
删除这个sql_mode.重启mysql.
将my.ini中的:
# set the sql mode to strict
sql-mode=strict_trans_tables,no_auto_create_user,no_engine_substitution
改为:
# set the sql mode to strict
#sql-mode=strict_trans_tables,no_auto_create_user,no_engine_substitution
sql-mode=no_auto_create_user,no_engine_substitution

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product