一、修改表
1.修改列为非空
alter table news modify column `time` date not null
2.修改表编码为utf8
alter table comment default character set utf83修改字段编码为utf8
alter table `comment` change `content` `content` text character set utf8
本文介绍了如何使用SQL语句来修改表结构,包括将列设置为非空、更改表及字段的字符编码为UTF-8等操作。这些技巧对于数据库管理和维护非常实用。
一、修改表
1.修改列为非空
alter table news modify column `time` date not null
2.修改表编码为utf8
alter table comment default character set utf83修改字段编码为utf8
alter table `comment` change `content` `content` text character set utf8
被折叠的 条评论
为什么被折叠?
