MySQL alter table命令不起作用

Tec*_*lco 4 mysql sql

我正在尝试向现有用户表添加一列,但它不起作用.我明白了:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'unsigned default 0 after users_id' at line 1
Run Code Online (Sandbox Code Playgroud)

这是我的命令:

root@localhost:test> alter table users add column users_is_active tinyint(3) not null unsigned default 0 after users_id;
Run Code Online (Sandbox Code Playgroud)

除非我没有正确地拼写"非空",我做错了什么?谢谢

Kus*_*nda 19

alter table users添加列users_is_active tinyint(3)not null unsigned default 0 after users_id;

TINYINT(3) UNSIGNED是类型.NOT NULL不属于TINYINT(3)UNSIGNED.而是说TINYINT(3) UNSIGNED NOT NULL(等).