
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How to display all the MySQL tables in one line?
Use information_schema.tables to display all the tables. With that, se the database name as well, so that you can display tables only from a specific database.
Let us now display all the tables in the database “web” −
mysql> select group_concat(table_name) from information_schema.tables where table_schema='web';
This will produce the following output −
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | group_concat(table_name) | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | demo_table725,demotabe619,demotabe620,demotable211,demotable212,demotable213,demotable214,demotable215,demotable216,demotable217,demotable218,demotable219,demotable220,demotable221,demotable222,demotable223,demotable224,demotable225,demotable226,demotable227,demotable228,demotable229,demotable230,demotable231,demotable232,demotable233,demotable234,demotable235,demotable236,demotable237,demotable238,demotable239,demotable240,demotable241,demotable244,demotable245,demotable246,demotable247,demotable248,demotable249,demotable250,demotable251,demotable252,demotable 253,demotable254,demotable255,demotable256,demotable257,demotable258,demotable259,demotable260,demotable261,demotable262,demotable263,demotable264,demotable265,demotable266,demotable267,demotable268,demotable269,demotable270,demotable271,demotable272,demotable273,demotable274,demotable275,demotable276,demotable277,demotable278,demotable279,demotable280,demotable281,demotable282,demotable283,demotable284,demotable285,demotable286,demotable287,demotable28 | +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set, 1 warning (0.01 sec)
- Related Articles
- How to display all the tables in MySQL with a storage engine?
- How to display all tables in MySQL with InnoDB storage engine?
- How can I display all databases in MySQL and for each database show all tables?
- Display all tables inside a MySQL database using Java?
- Display all records except one in MySQL
- How to repair MySQL tables from the command line?
- How to display records vertically in MySQL command line?
- How to make MySQL display results in a single line?
- How to display some columns (not all) in MySQL?
- How to display tables using AngularJS?
- How to find all tables that contains columnA and columnB in MySQL?
- How to find all tables that contains two specific columns in MySQL?
- How to adjust display settings of MySQL command line?
- How to display multiple labels in one line with Python Tkinter?
- List down all the Tables in a MySQL Database

Advertisements