3

We can store binary values using either binary or bit (up to 64 bits).

What is the difference between using binary(n) vs using bit(m) (where n = 8 × m)?

Are they recognized as the same thing by MySQL?

(Assuming using MySQL >= 5.0.3.)

Community
  • 1
  • 1
Pacerier
  • 86,231
  • 106
  • 366
  • 634

1 Answers1

2

You can store bits using BIT or BINARY - as you want. The BIT data type may be more usable in logic operations.

There is a small difference in storage:

Devart
  • 119,203
  • 23
  • 166
  • 186
  • 1
    But what is the difference when we are using a multiple of 8 bits? Like `binary(2)` vs `bit(16)`? – Pacerier Dec 09 '14 at 12:35