过去我们常用命令
show databases
show tables
show processlist
其实这些都是来自于information_schema。当我开始了解information_schema的时候,我发现,原来这么多有趣的数据都被它保存了下来,熟悉此库对于理解mysql非常有帮助。
information_schema中的表保存了各种数据库信息。我觉得这个库里面的表很有用。
查看引擎
information_schema.ENGINS 对应于 show engines;
查看数据库
information_schema.SCHEMATA 对应于 show databases;
查看表
information_schema.TABLES 对应于 show tables;
查看列
information_schema.COLUMNS对应于show columns from table_name
查看索引
information_schema.STATISTICS 对应于show index from table_name
查看线程
information_schema.PROCESSLIST 随营业 show processlist
information_schema里面还有其他的表例如VIEWS, TRIGGERS,等等
关于mysql的几个问题 infomation_schema .tables里面的table_row和实际行数的关系
begin vs start transaction 没有区别,你可以理解为别名,作用都是开始一个事务。
本文详细介绍了MySQL中Information_Schema的重要性和使用方法。通过对比常用的SQL命令,如show databases、show tables等,展示了如何利用Information_Schema来获取更详细的数据库信息。包括查看引擎、数据库、表、列、索引及线程等方面的内容。

524

被折叠的 条评论
为什么被折叠?



