增: alter table 表名 add 字段名+数据类型, add 字段名+数据类型; alter table 表名 add primary key 字段: "添加主键" 删: alter table 表名 drop 字段, drop 字段; alter teble 表名 drop primary 字段: "删除主键" 改: alter table 表名 change 表名,新表名+数据类型: alter table 表名 modify 字段+新的数据类型 af…
登录数据库服务器 mysql -h127.0.0.1 -uroot -p123456 创建数据库 create database test; 显示所有数据库 show databases; 指定要操作的数据库 use test; 删除库 drop database test; 创建表 create table demo( id int primary key auto_increment, name char(30) not null )engine=innodb default charset…