mysql int 10 最大值_Mysql中int(10)的最大大小是多少
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 typ

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.
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) means you probably defined it as 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).
You can use BIGINT UNSIGNED if you want to store bigger values. See the MySQL docs: Integer Types (Exact Value)
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)