Mysql中int(10)的最大大小是多少 [英] What is the maximum size of int(10) in Mysql
问题描述
在我的数据库中,我声明了一个数据类型为Int(10)
的变量.如果在网页的文本框中键入数字,则该数字将存储在一个变量中,该变量的最大值可以是Mysql中的Int(10)
.如果我在文本框中输入一个非常大的数字,则会给出IndexOutofRangeException
.
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
.
所以我打算使用文本框的maximumlength
属性.在mysql中,类型为Int(10)
的变量中可以存储的最大数量是多少?
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?
推荐答案
INT(10)
意味着您可能将其定义为INT UNSIGNED
.
INT(10)
means you probably defined it as INT UNSIGNED
.
因此,您可以存储从0
到4294967295
的数字(请注意,最大值有10位数字,因此MySQL在列定义中自动添加了(10)
,其中(10)只是一种格式提示,仅此而已.它不会影响您可以存储多少数量.)
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).
如果要存储更大的值,可以使用BIGINT UNSIGNED
.参见MySQL文档:整数类型(精确值)
You can use BIGINT UNSIGNED
if you want to store bigger values. See the MySQL docs: Integer Types (Exact Value)
这篇关于Mysql中int(10)的最大大小是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!