MySQL Boolean "tinyint(1)" holds values up to 127? MySQL Boolean "tinyint(1)" holds values up to 127? mysql mysql

MySQL Boolean "tinyint(1)" holds values up to 127?


The signed TINYINT data type can store integer values between -128 and 127.

However, TINYINT(1) does not change the minimum or maximum value it can store. It just says to display only one digit when values of that type are printed as output.


The tinyint data type utilizes 1 byte of storage. 256 possible integer values can be stored using 1 byte (-128 through 127). if you define as tinyint unsigned then negative values are discarded so is possible to store (0 through 255).


See here for how MySQL handles this. If you use MySQL > 5.0.5 you can use BIT as data type (in older versions BIT will be interpreted as TINYINT(1). However, the (1)-part is just the display width, not the internal length.