mysql 中int(255)_如果我在MySQL中存储int(255),MAX编号是多少?
I use int(255) in mysql as my id. Is this long enough? If I got about 1,000,000 records....Thank you.解决方案Something is probably just converting that to int(11) for you. Since you can't have 255 visible
I use int(255) in mysql as my id. Is this long enough? If I got about 1,000,000 records....Thank you.
解决方案
Something is probably just converting that to int(11) for you. Since you can't have 255 visible digits in an int, the maximum value will be 2147483647.
If you need more than that you can set it to be unsigned, since I'm assuming you have no negative ids and then you can have up to4294967295`.
If you are ever going to have more than 4 billion records (very unlikely if you're at 1 million right now), then you could use a bigint instead, which allows you to store numbers up to 18446744073709551615 at a cost of more storage space of course.
更多推荐
所有评论(0)