检查数据库模式 mysql
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8479817/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Check database schemas mysql
提问by ewok
Is there a command in the MySQL command line client for windows that allows you to view all tables in a database, or display the schema of a particular table, similar to .tables
in sqlite3 or \dt
in psql?
在用于 Windows 的 MySQL 命令行客户端中是否有一个命令可以让您查看数据库中的所有表,或显示特定表的架构,类似于.tables
sqlite3 或\dt
psql?
回答by Nicola Cossu
show tables;
or
或者
select table_name from information_schema.tables where table_schema = 'your_db'
回答by Adrian Cornish
As the other said for the table list - if you want to see schema of a particular table use
正如另一个表列表所说 - 如果您想查看特定表的架构,请使用
SHOW CREATE TABLE foobar;
回答by BRPocock
[misread]
[误解]
You're looking for SHOW TABLES
it sounds like.
你正在寻找SHOW TABLES
它听起来像。
To see the schema of a table, use DESCRIBE table_name;
要查看表的架构,请使用 DESCRIBE table_name;