List all tables in a database

To list all tables in the mysql database, you can use this SQL

show tables from <databasename>;

or if the database already selected, can just use

show tables;

To list all fields in a table

show columns from <tablename>;

Leave a Reply

Your email address will not be published. Required fields are marked *