日期:2014-05-16 浏览次数:20846 次
mysql> create table t_zhyou110z ( -> userid int primary key, -> password varchar(10) -> ); Query OK, 0 rows affected (0.13 sec) mysql> desc t_zhyou110z; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+ | userid | int(11) | NO | PRI | NULL | | | password | varchar(10) | YES | | NULL | | +----------+-------------+------+-----+---------+-------+ 2 rows in set (0.11 sec) -- 修改password 为not null / ACMAIN mysql> alter table t_zhyou110z modify password varchar(10) not null; Query OK, 0 rows affected (0.22 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> desc t_zhyou110z; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+ | userid | int(11) | NO | PRI | NULL | | | password | varchar(10) | NO | | NULL | | +----------+-------------+------+-----+---------+-------+ 2 rows in set (0.00 sec) mysql>
------解决方案--------------------