MySQL Mysql中int(10)的最大大小是多少
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10879345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the maximum size of int(10) in Mysql
提问by Manoj Nayak
In my database I have declared a variable of datatype Int(10)
. If I type a number in a textbox in my web page, that number is stored in a variable whose largest value can be Int(10)
in Mysql. If I type a very large number in the textbox it is giving IndexOutofRangeException
.
在我的数据库中,我声明了一个 datatype 变量Int(10)
。如果我在网页的文本框中键入一个数字,该数字将存储在一个变量中,该变量的最大值可以Int(10)
在 Mysql 中。如果我在文本框中键入一个非常大的数字,它会给出IndexOutofRangeException
.
So I am planning to use the maximumlength
property of text box. What is the maximum number that can be stored in a variable of type Int(10)
in mysql?
所以我打算使用maximumlength
文本框的属性。Int(10)
mysql中类型变量可以存储的最大数量是多少?
回答by ypercube??
INT(10)
means you probably defined it as INT UNSIGNED
.
INT(10)
意味着您可能将其定义为INT UNSIGNED
.
So, you can store numbers from 0
up to 4294967295
(note that the maximum value has 10 digits, so MySQL automatically added the (10)
in the column definition which (10) is just a format hint and nothing more. It has no effect on how big number you can store).
所以,你可以存储从0
up 到的数字4294967295
(注意最大值有 10 位,所以 MySQL 自动(10)
在列定义中添加了(10)只是一个格式提示而已。它对你的数字有多大没有影响可以存储)。
You can use BIGINT UNSIGNED
if you want to store bigger values. See the MySQL docs: Integer Types (Exact Value)
BIGINT UNSIGNED
如果要存储更大的值,可以使用。请参阅 MySQL 文档:整数类型(精确值)
回答by Andrius Naru?evi?ius
回答by Divyansh Chaudhary
Just use BigInt Instead of Int in Mysql and if you want explanation in brief then goto
只需在 Mysql 中使用 BigInt 而不是 Int ,如果您想简要说明,请转到