Home >Database >Mysql Tutorial >How to update comments in mysql
Mysql method to update comments: execute the [ALTER TABLE `student` COMMENT `comment content`;] statement. After completion, you can check whether the comments are updated successfully by executing the [SHOW CREATE TABLE `table_name`;] statement.
First create a student table, the code is as follows:
(Recommended tutorial: mysql tutorial)
CREATE TABLE `student` ( `id` int(11) AUTO_INCREMENT PRIMARY KEY COMMENT '学好', `name` varchar(32) NOT NULL DEFAULT '' COMMENT '姓名', `sex` tinyint(1) NOT NULL COMMENT '性别', `age` tinyint(4) NOT NULL COMMENT '年龄', `class` varchar(32) NOT NULL DEFAULT '' COMMENT '班级' )ENGINE=InnODB CHARSET=utf8 COMMENT='学生表';
Then execute the following statement to update the comment
ALTER TABLE `student` COMMENT '学生表2.0';
After completion, execute the following statement to view the table comment
SHOW CREATE TABLE `student`
Related recommendations:php training
The above is the detailed content of How to update comments in mysql. For more information, please follow other related articles on the PHP Chinese website!