MySQL Bit Data Type Examples

The BIT data type is used to store bit-field values.


The bit(n) enables storage of n-bit values and n can be ranged from 1 to 64. Even though the range is quite big, bit(1) is often used.

Set value to bit(1) column (boolean)

b’value’ notation is used to set value to a column with bit data type.

b'1' //true
b'0' //false

0bvalue notation also can be used.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.