一尘不染

如何从 SHOW TABLE STATUS 结果中选择

mysql

我想限制从

SHOW TABLE STATUS

MySQL 5.1 中的命令。有没有办法通过SELECT语句获取相同的信息,以便我可以以正常方式操纵结果?


阅读 55

收藏
2022-10-10

共1个答案

一尘不染

这比 SHOW TABLE STATUS 有更多的列;但有诀窍:

SELECT * FROM information_schema.tables WHERE table_schema = DATABASE();

更新 2011-06-07 19:02

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 = DATABASE();

如果您设置当前数据库,这些查询将起作用。

您还可以对特定数据库进行硬编码:

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 = 'mysql';
2022-10-10