Get a list of tables via the MySQL command line

Question

How do I get a list of tables from the MySQL command line?

Answer

First: Switch to desired database

mysql> use dborc3_sqli;
Database changed

Next: Get list of tables

mysql> show tables;
+-----------------------+
| Tables_in_dborc3_sqli |
+-----------------------+
| contributor           |
| courses               |
| customers             |
| ensfields             |
| ensfiles              |
| heuristic             |
| mainmnuitem           |
| pagecontrib           |
| pgcontent             |
| pgcontenthdr          |
| pmainmnu              |
| sitearea              |
| siteareamnmnu         |
| siteareasubmnu        |
| sitecontentlicense    |
| siteproperties        |
| submnu                |
| submnulst             |
| test                  |
+-----------------------+
19 rows in set (0.00 sec)

mysql> 

If you find this site useful and are a book buyer/reader...

You can support my site by clicking on one of the Links below to Abe books

By doing this, I will receive a small commision on your purchase and making your purchase will not cost you any more money than if you went directly the site yourself! 

Abe Books sells books at a fraction of the original cost. I have purchased many books from them originally cost $40.00 for as little as $5 to $10 dollars including shipping costs


Click on applicable icon to find books at Abe Books on ...

MySQL MySQL & Php

Abe Books is one of my affiliates. I only use affiliates that I also purchase products from. I love Abe books. If it is printed they likely have a copy. I have also included a generic link to Abe Books below.

Once on their site, you will find that they have a nice, easy to use search engine so to find what you are looking for.

Free Shipping 125x125

MySQL How-To Map

MySQL How-To

Command Line

Database Development

DML













navTango.com free

75% of your donation

goes to charity.