如果我在MySQL中存储int(255),MAX编号是多少? [英] What is the MAX number if I store int(255) in MySQL?

查看:255
本文介绍了如果我在MySQL中存储int(255),MAX编号是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql中使用int(255)作为我的id。这够长吗?如果我有大约1,000,000条记录......谢谢。

I use int(255) in mysql as my id. Is this long enough? If I got about 1,000,000 records....Thank you.

推荐答案

有些东西可能只是转换为 int(11)您。由于 int 中不能包含255个可见数字,因此最大值将为 2147483647

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.

如果你需要更多,你可以将它设置为无符号,因为我假设你没有负面的ID然后你可以达到 4294967295`。

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`.

如果你有超过40亿条记录(如果你现在只有100万条记录则不太可能),那么您可以使用 bigint ,这样可以存储最多 18446744073709551615 的数字,但需要花费更多的存储空间。当然。

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.

这篇关于如果我在MySQL中存储int(255),MAX编号是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆