Home  >  Article  >  Backend Development  >  关于mysql修改,该如何解决

关于mysql修改,该如何解决

WBOY
WBOYOriginal
2016-06-13 10:11:19867browse

关于mysql修改
ALTER TABLE pre_forum_attachment CHANGE 'aid' 'aid' mediumint(8) unsigned NOT NULL AUTO_INCREMENT
执行不了怎么回事,提示错误是#1264 - Out of range value adjusted for column 'aid' at row 3 


------解决方案--------------------
bigint
从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据(所有数字)。存储大小为 8 个字节。

mediumint
带符号的范围是-8388608到8388607,无符号的范围是0到16777215,使用3个字节。
无符号的范围是0到16777215

由于 mediumint 的存储范围远小于 bigint,所以必然导致溢出
主键必须是唯一的
------解决方案--------------------
老大解释得很清楚了,其实你的英文提示也很清楚了.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn