MySQL中创建用户、创建数据库、表并付给用户权限、给字段添加注释
---创建数据库
CREATE DATABASE zdb_mysql;
---创建用户:
CREATE USER 'zdb_mysql'@'localhost' IDENTIFIED BY 'zdb_mysql'; #本地登录
---附权限:
grant all privileges on zdb_mysql.* to 'zdb_mysql' @'localhost' identified by 'zdb_mysql'; flush privileges; #刷新系统权限表
---创建表
create table class ( code varchar(20) primary key, name varchar(20) not null );
---给mysql表中字段添加注释;
ALTER TABLE CESHI MODIFY COLUMN class1 varchar(20) COMMENT '班级';