Is there a MySQL Value limit?

Discussion in 'MySQL' started by articledirectory, Sep 17, 2009.

  1. #1
    There seems to be a maximum value limit of 2147483647 that can be stored in the database, is there anyway to override this amount to make it larger or is there something i am doing wrong?
     
    Last edited: Sep 17, 2009
    articledirectory, Sep 17, 2009 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    What's the column type, and is it signed or unsigned?

    An unsigned BIGINT has a range of 0 to 18,446,744,073,709,551,615... So you can go to 18.4 quintillion.
     
    digitalpoint, Sep 17, 2009 IP
  3. articledirectory

    articledirectory Peon

    Messages:
    1,704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Shawn,
    It has "Type" int(10)
    "Function" is blank
    If i try and put a high value in, say 99999999999 it says
    "Warning: #1264 Out of range value adjusted for column 'cash' at row 1"
    and i end up with a value of "2147483647"
    Any ideas what i can do, i am still bit of a novice when it come to altering databases.
    Thanks.
     
    articledirectory, Sep 17, 2009 IP
  4. nyxano

    nyxano Peon

    Messages:
    417
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Int(10) means that the number can only have a maximum of 10 Digits in it. Your 99999999999 is 11 Digits long and therefore won't fit.

    Either change the Int(10) to a larger number OR as Shawn recommended, use BIGINT.
     
    nyxano, Sep 17, 2009 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    An unsigned INT stores up to 4.2B.

    An unsigned BIGINT stores up to 18446744073709551615, which is insanely large. Out of curiosity, what are you doing that is requiring numbers this large without being able to use some scientific or exponential format?
     
    jestep, Sep 17, 2009 IP
  6. elbeer

    elbeer Active Member

    Messages:
    619
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    70
    #6
    change int to bigint(100)
     
    elbeer, Sep 25, 2009 IP
  7. articledirectory

    articledirectory Peon

    Messages:
    1,704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks, i have gone through my database now and change all instances to bigint, funny you should reply to this thread as i just sent you a PM LOL :)
    Regards.
     
    articledirectory, Sep 25, 2009 IP