mysql数据表的字段操作

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

 

posted @ 2017-07-14 22:48  帅LOVE俊  阅读(157)  评论(0编辑  收藏  举报