15

I'm trying to create a new column as boolean type, but I can't find it in the list..any help?

5.2.37 and ubuntu 11.10

tirenweb
  • 30,963
  • 73
  • 183
  • 303

3 Answers3

21

There is no such thing as a 'boolean' in MySql unfortunately.

I think you need tinyint(1).

This question has more: Which MySQL data type to use for storing boolean values

Community
  • 1
  • 1
Widor
  • 13,003
  • 7
  • 42
  • 64
7

Skip the workbench and use the command line

alter table my_table add column my_column BOOLEAN;
0

To Create a Boolean Column in Table with default false

ALTER TABLE table_name ADD field_name tinyint(1);

if default true

ALTER TABLE table_name ADD field_name tinyint(0);   
Rakesh
  • 81,458
  • 17
  • 76
  • 113
  • 3
    Rakesh your answer is not correct (or is partially correct), the value in parentheses isn't the default value, and do not affect the data type at all. It's called "Data-wise", or display size and it is merely a display width hint. https://dba.stackexchange.com/a/55062 – tecla Apr 25 '20 at 03:41