问题:
在mysql中,数据库是以目录形式存在于datadir下。新的数据库初始化完成后,会出现mysql、performance_schema、test这几个目录,也就是系统初始化的库。我们知道,在mysql中还有一个库:information_schema,为什么这个库没有在datadir下以目录的形式存在呢?
解答:
看下官网文档,对information_schema的解释:
INFORMATION_SCHEMA
provides access to database
metadata
, information about the MySQL server such as the
name of a database or table, the data type of a column, or access privileges. Other terms that are sometimes
used for this information a
re
data dictionary
and
system catalog
.
INFORMATION_SCHEMA
is a database within each MySQL instance, the pla
ce that stores information about all the other databases that the MySQL server maintains. The
INFORMATION_SCHEMA database contains several read-only tables. They are actually views, not base tables, so there are no files associated with them, and you cannot set triggers on them. Also, there is no database directory with that name.
通过官网文档对information_schema库的解释,可以发现:
1.information_schema的作用是记录数据库的一些元数据信息(metadata)。这些信息包括数据库名、列的类型、访问权限等等。
2.information_schema包含的是一些只读表。
3.information_schema下面的表,实际上是视图,不是真正的表。
所以,我们可以知道,information_schema,没有与之对应的目录。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26418713/viewspace-1392913/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26418713/viewspace-1392913/