mysql -u root -p;登錄
show databases; 查看數(shù)據(jù)庫目錄
show databases like 'db_%';
create database test character set=utf8;創(chuàng)建一個test數(shù)據(jù)庫
create schema test character set=utf8;
create database test charset utf8;
create database if not exists test;如果不存在test數(shù)據(jù)庫就創(chuàng)建一個
alter database test charset utf8;修改test數(shù)據(jù)庫的字符集
alter database test character set=utf8;
drop database test识啦;刪除一個test數(shù)據(jù)庫
drop database if not exists test;如果存在刪除渔肩,不存在就忽略
use database test;進(jìn)入或選擇一個test的數(shù)據(jù)庫
help XXX;查看一個命令的詳細(xì)情況
show create database test;查看test數(shù)據(jù)庫
show engines \G;顯示存儲引擎的狀態(tài)信息
show engines;
show engines like 'default%'; 顯示存儲引擎默認(rèn)的狀態(tài)信息
show variables; 查看系統(tǒng)變量及其值;
show variables \G;
show variables like 'default_storage_engine';查看默認(rèn)數(shù)據(jù)庫引擎
show variables like 'default%';