MySQL table schema details

I am mentioning here a quick way to get the table schema format.

Steps
1) Login to your database using mysql -u {username} -p -h {host_name> -D {database_name}

2) Execute query
SELECT TABLE_NAME AS `Table`, ROW_FORMAT AS `Format` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "{database_name}"

3) Primarily there are two types of format Dynamic and Compact

You can use below queries to check the details further,

SELECT TABLE_NAME AS `Table`, ROW_FORMAT AS `Format` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "{database_name}" and ROW_FORMAT = 'Compact';
OR
SELECT TABLE_NAME AS `Table`, ROW_FORMAT AS `Format` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "{database_name}" and ROW_FORMAT = 'Dynamic';

Hope this is helpful.

Leave a Reply

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

Scroll to top