What is the maximum size of int(10) in Mysql

前端 未结 3 1892
时光取名叫无心
时光取名叫无心 2021-02-06 21:23

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 val

3条回答
  •  逝去的感伤
    2021-02-06 21:48

    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)

提交回复
热议问题