要查询数据库数据最多的前50个表
SELECT CONCAT( table_schema, '.', table_name ) table_name,
CONCAT( ROUND( data_length / ( 1024 *1024 ) , 2 ) , 'M' ) data_length,
CONCAT( ROUND( index_length / ( 1024 *1024 ) , 2 ) , 'M' ) index_length,
CONCAT( ROUND( ROUND( data_length + index_length ) / ( 1024 *1024 ) , 2 ) , 'M' ) total_size
FROM information_schema.TABLES
ORDER BY data_length DESC;
其他的要求都可以根据这个sql来更改
具体参考点击打开链接
下面是简单点儿的
SELECT TABLE_NAME,TABLE_ROWS FROM information_schema.tables WHERE TABLE_SCHEMA='gao' ;
如果要查看更多
SELECT TABLE_NAME,DATA_LENGTH+INDEX_LENGTH,TABLE_ROWS FROM information_schema.tables WHERE TABLE_SCHEMA='database_name' AND TABLE_NAME='table_name';