bd96500e110b49cbb3cd949968f18be7.png

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.

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐