Note: This article was originally published in 2013. Some steps, commands, or software versions may have changed. Check the current MySQL documentation for the latest information.

(http://www.mysql.com “MySQL”): How to list all available tables in the system

Because sometimes you just need to know (the available tables are out there so you can use that list in a script). If you are running MySQL Workbench you can execute the following SQL Query and export the results to a file:

select table_name from information_schema.tables where table_name like ‘wp_%’

If you are running mysql from a command line you can leverage this to create your output file:

mysql -N information_schema -e “select table_name from tables where table_name like ‘wp_%’” > tables.txt

Then of course you could use your tables.txt file as input for another SQL query.

(http://img.zemanta.com/zemified_h.png?x-id=101fbe04-d3d7-479e-8907-45c3bbb8705c)](http://www.zemanta.com/?px “Enhanced by Zemanta”)