【查阅】mysql系统视图查看

【1】查看表大小

复制代码
SELECT
    CONCAT(table_schema,'.',table_name) AS 'Table Name',
    table_rows AS 'Number of Rows',
    CONCAT(ROUND(data_length/(1024*1024),3),' MB') AS 'Data Size',
    CONCAT(ROUND(index_length/(1024*1024),3),' MB') AS 'Index Size',
    CONCAT(ROUND((data_length+index_length)/(1024*1024),3),' MB') AS 'Total Size'
FROM
    information_schema.TABLES
WHERE
    table_schema = 'test' AND table_name in ('test101','test102');
复制代码

 【2】基本命令

复制代码
【2.1】查看数据库版本:show variables like 'version';
【2.2】列出所有数据库:show databases;
【2.3】查看服务器状态:status;
【2.4】查看数据库存储引擎:show engines;
【2.5】查看数据库存储引擎插件:show plugins;
【2.6】查看数据库状态统计:show status;
【2.7】查看数据库参数:show variables;
【2.8】查看复制容灾:show master status; show slave status;
【2.9】查看单机还是集群:show variables like '%ckuster%';
【2.10】查看触发器,查看存储过程: show triggers;     show procedure status;
【2.11】查看当前mysql的线程:show process list;
【2.12】查看用户授权:show grants for root;
【2.13】更多
show table……
show index……
【2.14】查看当前会话的CRUD等次数:show status like 'com_%';
【2.15】查看字符集:show character set; show variables like 'character%';
【2.16】查看排序规则:show collation;
【2.17】查看数据库排序规则:show variables like 'collation%';

复制代码

 【3】系统视图

3.1】查看字符集:select * from information_schema.character_sets;
【3.2】查看排序规则:select * from information_schema.collations;

 

posted @   郭大侠1  阅读(1462)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示