How to select all tables in mysql

Asked

Viewed 2,173 times

2

What query makes me query a certain database in mysql that brings me all its tables?

  • Yes it is possible!

  • 1

    show Tables ...

  • but how? a friend of mine said he had to inform the schema... but I could not find

  • damn... show Tables worked... rs

  • 2

    I don’t understand the downvote ...

  • neither I, never mind

Show 1 more comment

3 answers

3

  • 2

    helped and a lot, I did not use the from, as I was at the base used only "show Tables"

2


mysql> USE test;
Database changed
mysql> SHOW TABLES;

+----------------+
| Tables_in_test |
+----------------+
| t1             |
| t2             |
| t3             |
+----------------+
3 rows in set (0.00 sec)

I believe that’s what you’re asking, it’s a little wide.

  • 1

    is the simplest command of the solutions presented!

1

You can do this in Mysql, through information_schema that stores database metadata.

SELECT * FROM information_schema.tables WHERE table_schema = 'database'
  • the other commands are simpler, but this solution brings more details

  • @Dichrist yes you can other information there depends on your need.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.