mysql 基本操作 alter

查看数据库 show  databases;

新建数据库 命令 create database 库名字。

选择数据库 use  2016test;

创建表:create table 表名(字段1,2,3....);

auto_increment 自增

primary key  主键

查看表结构  : describe  表名

显示表:

插入数据

查表 

删除字段名:

alter table 表名 drop 字段名称;

增加表字段

alter table 表名 add 字段名称  类型;

修改表字段:

alter table 表明 change 字段名 新字段名  新字段类型;

修改字段类型

alter table  表名 modify 要修改的字段名  新的字段类型;

查看表引擎:

show create table 2016_test;

。。。。

。。。。

修改表引擎:

 alter table 2016_test ENGINE=myisam;

原文地址:https://www.cnblogs.com/yhl664123701/p/5621328.html