Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the mediumint type in mysql

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces what is the use of mediumint type in mysql. The introduction in this article is very detailed and has certain reference value. Interested friends must read it!

Data type-mediumint type in mysql If you manually set "length" to 3, will it have an effect?

mediumint type problem

Check it out, it's usually said like this:

TINYINT--a tiny integer that supports-128 to 127 (SIGNED), 0 to 255(UNSIGNED) and requires 1 byte of storage

BIT--Same as TINYINT(1)

BOOL--Same as TINYINT(1)

SMALLINT--A small integer that supports-32768 to 32767 (SIGNED), 0 to 65535(UNSIGNED) and requires 2 bytes of storage

MEDIUMINT--a medium integer supporting-8388608 to 8388607 (SIGNED), 0 to 16777215(UNSIGNED), requiring 3 bytes of storage

INT--an integer supporting-2147493648 to 2147493647 (SIGNED), 0 to 4294967295(UNSIGNED), requiring 4 bytes of storage

INTEGER--Same as INT

BIGINT--a large integer, supports-9223372036854775808 to 9223372036854775807 (SIGNED), 0 to 18446744073709551615(UNSIGNED), requires 8 bytes of storage

When using visualization tools like Navicat, the "length" item can be changed. That is, I can change the length of mediumint to 3, or tinyint to 10…

I tried to change it and looked at the data in the table again. It didn't change.

mediumint type meaning

I'm just asking, what's really in effect here is "type," right?

I searched again and found this:

int(1) and tinyint(1) in mysql only specify the display length, not the storage length, only the field specifying zerofill is useful

For example, int(3), if the actual value is 2, if the column specifies zerofill, the query result is 002, and the left side is filled with zeros.

Bit limits are largely meaningless.

The above is "mysql mediumint type what to use" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report