Which data type should I use to store a number(ID) like "10196385171799537224"(21 digits) in MySQL database?
Asked
Active
Viewed 7,253 times
2

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Saliha Uzel
- 141
- 2
- 5
- 17
-
try checking out this question! it helps http://stackoverflow.com/questions/1211413/storing-very-large-integers-in-mysql – Bala Sep 29 '12 at 14:05
2 Answers
4
Per the MySQL docs, you'd need a NUMERIC(21,0)
.
However, that's a unfeasibly large ID. Adding entries at a rate of one per microsecond, it would take over 300,000 years to reach that number. You might want to reconsider your design.

Dancrumb
- 26,597
- 10
- 74
- 130