Show or list tables in a MySQL database

Contributor Icon Contributed by webgod Date Icon February 22, 2005  
Tag Icon Tagged: MySQL

Once you have selected a database, you can list the tables in it by using the show command.


To view all of the tables in the selected database, use:

SHOW TABLES;
[code]
To view all of the tables in a different database that isn't selected:

[code]SHOW TABLES IN other_database;

If you are looking for a specific table but don't remember it's exact name, you can use a wildcard with either of the above commands. For example, to find tables ending in "user" from the database "bigdb" use:

SHOW TABLES IN bigdb LIKE '%user';

Previous recipe | Next recipe |
 
  • Code-like-hell-Programmer
    tnx...this was what im looking for...oh BTW can i request something can you post a thourough guide in connecting jsp with mysql...if you would be kind enough to include instructions in setting paths and etc...i would greatly appreciate in...thanks in advance...and good job...
  • Mahmudul
    It work's.
    Exactly what I was looking for.
  • novice_programmer
    thanks man,its cool
blog comments powered by Disqus