ewok
ewok

Reputation: 21443

Check database schemas mysql

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?

Upvotes: 4

Views: 41411

Answers (3)

BRPocock
BRPocock

Reputation: 13914

[misread]

You're looking for SHOW TABLES it sounds like.

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

Upvotes: 8

Adrian Cornish
Adrian Cornish

Reputation: 23848

As the other said for the table list - if you want to see schema of a particular table use

SHOW CREATE TABLE foobar;

Upvotes: 5

Nicola Cossu
Nicola Cossu

Reputation: 56357

show tables;

or

select table_name from information_schema.tables where table_schema = 'your_db'

Upvotes: 7

Related Questions