You must specify 0 (false) or 1 (true) as the default. Here is an example:
create table mytable ( mybool boolean not null default 0 );
FYI: boolean is an alias for tinyint(1) .
Here is the proof:
mysql> create table mytable ( -> mybool boolean not null default 0 -> ); Query OK, 0 rows affected (0.35 sec) mysql> insert into mytable () values (); Query OK, 1 row affected (0.00 sec) mysql> select * from mytable; +--------+ | mybool | +--------+ | 0 | +--------+ 1 row in set (0.00 sec)
FYI: my test was performed in the following version of MySQL:
mysql> select version(); +----------------+ | version() | +----------------+ | 5.0.18-max-log | +----------------+ 1 row in set (0.00 sec)
Asaph Feb 08 '10 at 11:02 2010-02-08 11:02
source share