当前位置:Gxlcms > 数据库问题 > mysql数据表的字段操作

mysql数据表的字段操作

时间:2021-07-01 10:21:17 帮助过:22人阅读

CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`PASSWORD` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;

修改字段

alter table users modify password varchar(255) not null default ‘‘ comment ‘测试‘

增加字段

alter table users add column remark varchar(255) not null default ‘‘ comment ‘备注‘

删除字段

alter table users drop column remark

 

mysql数据表的字段操作

标签:字段   mysql   mark v   charset   comment   myisam   user   sam   modify   

人气教程排行