Home>Article>Database> How to modify comments in mysql

How to modify comments in mysql

青灯夜游
青灯夜游 Original
2021-12-31 16:50:39 13513browse

Modification method: 1. Use the "alter table table name comment 'comment content';" statement to modify the table's comments; 2. Use "alter table table name modify column field name type comment 'comment content' ;" statement can modify the comment of the field.

How to modify comments in mysql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

Write a comment when creating the table and use the comment keyword

Syntax:

create table 表名 ( 字段名 类型 comment '字段的注释' )comment='表的注释';

Check it out

Modify table comments

alter table 表名 comment '修改后的表的注释';

##Modify field comments

alter table 表名 modify column 字段名称 字段类型 comment '修改后的字段注释';

## [Related recommendations:

mysql video tutorial

]

The above is the detailed content of How to modify comments in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn