Search code examples
mysqlbittinyint

What is the difference between BIT and TINYINT in MySQL?


In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans?


Solution

  • A TINYINT is an 8-bit integer value, a BIT field can store between 1 bit, BIT(1), and 64 bits, BIT(64). For a boolean values, BIT(1) is pretty common.