BIGINT(8)是mysql可以存储的最大整数吗? [英] Is BIGINT(8) the largest integer mysql can store?

查看:131
本文介绍了BIGINT(8)是mysql可以存储的最大整数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些现在大于INT可以处理的数字.

I've got some numbers that is now larger than INT can handle.

这有点尴尬,但是老实说,我不确切知道BIGINT(8)的含义.是最大位数还是最大长度是8?

This is a bit embarassing, but I honestly don't know exactly what the BIGINT(8) means. Is the 8 in that the max bit value or the max length?

那么BIGINT(1)只能是一位数字吗?还是BIGINT(1)还有其他东西?我认为tinyint(1)最大值为127,如何计算出来?

So BIGINT(1) can only be one digit? Or is BIGINT(1) something else? I think tinyint(1) max is 127, how does that work out?

我可以做BIGINT的最大笔钱是什么? 我可以在mysql中存储为整数的最大数字是多少?

What is the biggest I can make BIGINT? What is the largest number I can store in mysql as an integer?

推荐答案

该数字表示其显示方式-不会影响数据的存储方式.

The number represents how it's displayed - it doesn't affect how the data is stored.

手册:

MySQL支持另一个扩展,可以选择在整数关键字的类型的基本关键字(例如INT(4))后的括号中指定整数数据类型的显示宽度.应用程序可以使用此可选的显示宽度来显示整数值,该整数值的宽度小于为列指定的宽度,方法是用空格左键填充它们. (也就是说,此宽度存在于结果集返回的元数据中.是否使用该宽度取决于应用程序.)

Another extension is supported by MySQL for optionally specifying the display width of integer data types in parentheses following the base keyword for the type (for example, INT(4)). This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)

显示宽度不限制可以存储在列中的值的范围,也不限制宽度超过该列指定的值的显示位数.例如,指定为SMALLINT(3)的列通常具有-32768到32767的SMALLINT范围,并且使用三个以上的字符来显示三个字符所允许的范围之外的值.

The display width does not constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column. For example, a column specified as SMALLINT(3) has the usual SMALLINT range of -32768 to 32767, and values outside the range allowed by three characters are displayed using more than three characters.

BIGINT始终为8个字节,并且可以存储-9223372036854775808至922337203685477575807(带符号)或0至18446744073709551615(无符号).

A BIGINT is always 8 bytes and can store -9223372036854775808 to 9223372036854775807 (signed) or 0 to 18446744073709551615 (unsigned).

这篇关于BIGINT(8)是mysql可以存储的最大整数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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