检查数据库模式 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 22:00:37  来源:igfitidea点击:

Check database schemas mysql

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 .tablesin sqlite3 or \dtin psql?

在用于 Windows 的 MySQL 命令行客户端中是否有一个命令可以让您查看数据库中的所有表,或显示特定表的架构,类似于.tablessqlite3 或\dtpsql?

回答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 TABLESit sounds like.

你正在寻找SHOW TABLES它听起来像。

To see the schema of a table, use DESCRIBE table_name;

要查看表的架构,请使用 DESCRIBE table_name;