How to select all tables in mysql

2

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

    
asked by anonymous 11.03.2016 / 18:23

3 answers

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

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

I think that's what you're asking for, it's a little broad.

    
11.03.2016 / 18:28
3

You can use show tables for this purpose, see an example:

show tables from
minhaBaseDeDados;

It accepts the from clause, and with it you can specify your database.

Source: link

    
11.03.2016 / 18:29
1

You can do this in MySQL, using the information_schema that keeps the meta database data.

SELECT * FROM information_schema.tables WHERE table_schema = 'database'
    
11.03.2016 / 18:28