-- 修改表名ALTER table test rename tests;rename table tests to test-- 修改表字符集alter table test charset gbk-- 清空表数据 逐条进行删除比较慢delete FROM test -- 清空表 比较快TRUNCATE test -- 删除表drop table if exists test-- 修改字段属性alter table test modify brandName varchar (150) null-- 修改字段名称alter table test change brandName bName varchar (100) not null-- 添加字段并且制定字段位置 只能放字段的后面 或者最前面alter table test add made varchar (100) default null after description-- 添加到最前面alter table test add g_size varchar (50) default null first-- 删除字段alter table test drop g_size-- 删除主键alter table test modify id int not nullalter table test drop primary key-- 添加主键alter table test add primary key (id) -- 添加自增列和主键一起alter table test modify id int auto_increment, add primary key (id)