mysql常用命令

it2022-05-05  204

show databases ; 显示所有数据库use dataBase_name; 进入对应数据库show tables; 显示表desc table_name; 显示表字段show create table 表名; 显示创建表关系sql语句\q; 退出mysql数据库操作alter table 数据库名.表名 modify column 字段名 varchar(32) not null; 修改表字段长度alter table 表名 add column 字段名2 int not null default 0 after 字段名1; 在字段名1后面新增字段名2alter table 表名 change 旧字段名 新字段名 not null comment ‘备注’; 修改字段名

最新回复(0)