MYSQL:
查询支持的所有引擎
数据库
show engines;
查询默认的存储引擎:
spa
show variables like 'storage_engine%'; //或 show variables like 'storage%';
建立数据表:
3d
create [temporary] table [if not exists] #(); //temporary:建立一个临时表;
查看表:
code
show tables;//#:数据库名
查看表结构:
blog
show columns from hello_01 frim hello;
describe #;
describe hello_01 id; //或 desc hello_01 id;
修改表:
添加列:
图片
alter table hello_01 add password varchar(20);
修改列:
table
alter table hello_02 modify name varchar(30);
删除列:
class
alter table hello_01 drop password; //或 alter table hello_01 drop column name;
查询表数据:
bfc
select * from hello_02;
重命名表:
select
rename table #1 to #2;
复制表:
//不复制数据 create table hello_02copy like hello_02;
//且复制数据: create table hello_02copy01 as select * from hello_02;
删除表:
drop table hello_02copy01; //或 drop table hello_02copy01; drop table if exists hello_02copy;