Monday 1 September 2014

how to filter the table status output from mysql

show table status is a handy command to get the table status, but you can't filter the fields you want as normal select statement. Here is the alternative way to get the output
SELECT table_name,Engine,Version,Row_format,table_rows,Avg_row_length,
  Data_length,Max_data_length,Index_length,Data_free,Auto_increment,
  Create_time,Update_time,Check_time,table_collation,Checksum,
  Create_options,table_comment
FROM information_schema.tables
WHERE Table_Schema='MyTableName';
you can replace 'MyTableName' with the table you want.

No comments:

Post a Comment