Mysql查看数据库对象(SQL命令总结)

Mysql查看数据库对象(SQL命令总结)数据的对象包括表,视图,,触发器,等等(查看统计信息的必须进入information_schema 数据库)举例查看表相关的信息,步骤如下1、使用information_schema 数据库use information_schema;2、查询所有数据的大小(MB):select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables; 3、查看指定数据库(schema)的大小(MB):select concat(round(sum(data_length/1024/1024),2),'MB') as DB_size from tables where table_schema='ehr';4、查看指定数据库的指定表(table)的大小select concat(round(sum(data_length/1024/1024),2),'MB') as table_size from tables where table_schema='ehr' and table_name='ehr_age';

实际生产环境:比逐条执行SQL查看统计信息更厉害的就是现在的UI界面,但是根本的还是SQL语句!

我喜欢出发。凡是到达了的地方,

Mysql查看数据库对象(SQL命令总结)

相关文章:

你感兴趣的文章:

标签云: