What is the difference between BIT and TINYINT in MySQL?

carrier picture carrier · Nov 14, 2008 · Viewed 113.1k times · Source

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

Answer

Robert Gamble picture Robert Gamble · Nov 14, 2008

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.