- 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后面新增字段名2
- alter table 表名 change 旧字段名 新字段名 not null comment ‘备注’; 修改字段名
mysql常用命令
最新推荐文章于 2023-05-20 16:02:12 发布