http://dev.mysql.com/doc/refman/5.0/en/alter-table.htmlALTER TABLE t1 CHANGE a b INTEGER;If you want to change a column's type but not the name, CHANGE syntax still requires an old and new column name, even if they are the same. For example:ALTER TABLE t1 CHANGE b b BIGINT NOT NULL;You can also use MODIFY to change a column's type without renaming it:ALTER TABLE t1 MODIFY b BIGINT NOT NULL;When you use CHANGE or MODIFY, column_definition must include the data type and all attributes that should apply to the new column, other than index attributes such as PRIMARY KEY or UNIQUE. Attributes present in the original definition but not specified for the new definition are not carried forward. Suppose that a column col1 is defined as INT UNSIGNED DEFAULT 1 COMMENT 'my column' and you modify the column as follows:ALTER TABLE t1 MODIFY col1 BIGINT;The resulting column will be defined as BIGINT, but will not include the attributes UNSIGNED DEFAULT 1 COMMENT 'my column'. To retain them, the statement should be:ALTER TABLE t1 MODIFY col1 BIGINT UNSIGNED DEFAULT 1 COMMENT 'my co
ALTER TABLE a ADD aId INT(10) DEFAULT '-1'否则总是失败
去掉UNSIGNED .
因为你从不看MYSQL的帮助文档。