Home > Database > Mysql Tutorial > What is the actual size of an INT(11) column in MySQL?

What is the actual size of an INT(11) column in MySQL?

Linda Hamilton
Release: 2024-12-21 13:01:14
Original
814 people have browsed it

What is the actual size of an INT(11) column in MySQL?

Column Size of int(11) in MySQL

The size of a column defined as int(11) in MySQL is consistently 4 bytes, regardless of the specified length. This is attributed to the fact that INT data types always occupy 4 bytes regardless of their length.

MySQL provides various integer data types with varying sizes:

  • TINYINT: 1 byte
  • SMALLINT: 2 bytes
  • MEDIUMINT: 3 bytes
  • INT: 4 bytes
  • BIGINT: 8 bytes

The specified length, known as display width, primarily determines the number of characters allocated when displaying data within the MySQL command-line client. For instance, int(3) can accommodate values like 12345, which will be displayed as 12345. However, int(10) stores the same value but allows for padding.

Regarding maximum values, an int(11) can store signed values up to 2,147,483,647 or unsigned values up to 4,294,967,295.

The above is the detailed content of What is the actual size of an INT(11) column in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template