首頁  >  文章  >  資料庫  >  查看資料庫的命令是什麼

查看資料庫的命令是什麼

王林
王林原創
2020-07-17 09:34:4919583瀏覽

檢視資料庫的指令是:【show databases】,指令可以檢視所有的資料庫。如果我們要查看資料庫中的表,可以使用指令【show tables】。如果輸入了錯誤指令,可以使用【\c】結束。

查看資料庫的命令是什麼

檢視資料庫可以使用show databases指令,該指令可以檢視所有的資料庫,等同於下列指令

(推薦教學:mysql教學

select schema_name from information_schema.schemata\G

相關介紹:

使用use 指令可以選擇資料庫例如use information_schema,使用此指令後

select schema_name from information_schema.schemata\G

可以為

select schema_name from schemata\G

如果要查看資料庫中的表,可以使用指令

show tables

同樣也可以在information_schema中查看,show指令是方便使用的簡短模式。

select table_name from tables where table_schema='jblog';

如果要查看表結構,可以使用命令

desc  table_name;

如果要查看表狀態,可以使用命令

show table status from db like 条件

提示:當多行命令輸入,發現錯誤後,可以用\c結束。

以上是查看資料庫的命令是什麼的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn