Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Oct 062010
 

Show all tables started with a prefix in MySQL

Answer:

If your database has a lot of tables, and you want to list all the tables started with a name prefix, you can try:

mysql> SHOW TABLES LIKE 'cache%';
+--------------------------------+
| Tables_in_mydb (cache%) |
+--------------------------------+
| cache                          |
| cache_block                    |
| cache_bootstrap                |
| cache_field                    |
| cache_filter                   |
| cache_form                     |
| cache_image                    |
| cache_menu                     |
| cache_page                     |
| cache_path                     |
| cache_update                   |
+--------------------------------+
11 rows in set (0.00 sec)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>