1 回答

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個(gè)贊
1.查看數(shù)據(jù)庫,選中使用數(shù)據(jù)庫,并查看數(shù)據(jù)庫表,具體操作命令如下:
show databases;
use student;
show tables;
2.選擇student數(shù)據(jù)庫中的一張表stu_score,查看數(shù)據(jù)庫表數(shù)據(jù),并利用explain分析數(shù)據(jù)庫表,如下圖所示:
select * from stu_score;
explain select * from stu_score;
3.查看數(shù)據(jù)庫使用索引的情況,使用命令:
show status like 'Handler_read%';
4.用于分析和存儲(chǔ)表的關(guān)鍵字,分析的結(jié)果可以得到精準(zhǔn)的信息,利用命令analyze,
analyze table stu_score;
5.檢查數(shù)據(jù)庫表stu_score,檢查表是否有錯(cuò)誤,利用命令:
check table stu_score;
6.優(yōu)化數(shù)據(jù)庫表,利用命令:
optimize table stu_score;
添加回答
舉報(bào)