- 数据库
- 显示所有数据库:show databases
- 创建数据库:create database 数据库名
- 选择数据库:use 数据库名
- 显示当前数据库:select database()
- 删除数据库:drop database 数据库名
- 表
- 创建表:create table 表名(字段名 字段类型 [not null][unique][auto_increment][primary key][comment ‘‘]);
- 查看表结构:
- describe 表名
- show columns 表名
- show create table 表名
- 删除表:drop table 表名
- 删除表内容,保留表结构:truncate table 表名
- 删除表内容:delete from 表名 where 删除条件
mysql基础
标签:bsp 保留 类型 use 创建表 key rop mysql基础 结构