查看數(shù)據(jù)庫的命令是:【show databases】,該命令可以查看所有的數(shù)據(jù)庫。如果我們要查看數(shù)據(jù)庫中的表,可以使用命令【show tables】。如果輸入了錯(cuò)誤命令,可以使用【\\\\c】結(jié)束。
查看數(shù)據(jù)庫可以使用show databases命令,該命令可以查看所有的數(shù)據(jù)庫,等同于如下命令
(推薦教程:mysql教程)
select schema_name from information_schema.schemata\\\\g相關(guān)介紹:
使用 use 命令可以選擇數(shù)據(jù)庫 例如 use information_schema,當(dāng)使用此命令后
select schema_name from information_schema.schemata\\\\g可以為
select schema_name from schemata\\\\g如果要查看數(shù)據(jù)庫中的表,可以使用命令
show tables同樣也可以在information_schema中查看,show命令是方便使用的簡(jiǎn)短模式。
select table_name from tables where table_schema='jblog';如果要查看表結(jié)構(gòu),可以使用命令
desc table_name;如果要查看表狀態(tài),可以使用命令
show table status from db like 條件提示:當(dāng)多行命令輸入,發(fā)現(xiàn)錯(cuò)誤后,可以用\\\\c結(jié)束。