当前位置:Gxlcms > 数据库问题 > mysql 基本操作 alter

mysql 基本操作 alter

时间:2021-07-01 10:21:17 帮助过:2人阅读

查看数据库 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;

技术分享

 

mysql 基本操作 alter

标签:

人气教程排行