information_schema数据库代表什么?
我在mysql中有一个数据库。
但是当我登录 phpMyAdmin 时,它显示另一个名为 information_schema 的数据库。
该数据库是否始终与一个数据库一起存在?
我的意思是说,mysql 中存在的每个数据库是否都有一份 information_schema 的副本,或者每个 mysql 服务器是否有一个名为 information_schema 的数据库?
如果我修改此 information_schema 数据库,这将如何影响我当前的数据库?
I have one database in mysql.
But when i log into phpMyAdmin , it shows another database called information_schema.
Is that database always present with one database?
I mean to say is there a copy of information_schema for every database present in mysql or is there one database called inforemation_schema per mysql server?
If i modify this information_schema database how will that affect my current database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将 information_schema 视为一个“主数据库”,它保存有关服务器上所有其他数据库的详细信息,例如表、列和用户的名称和类型。
什么是信息架构?
来自参考文档:
information_schema 中存储了什么?
您可以通过查看 this 来查看 information_schema 中存储的内容类型以及它们的组织方式图(适用于 MySQL 5.0)或此图(适用于MySQL 5.1)。
如果我修改 information_schema 会发生什么?
实际上,information_schema 是只读视图的集合。因此,不可能对其进行修改并造成任何损坏。但是,有关此主题的 MySQL 常见问题解答这就是说:
这意味着,如果您确实发现自己能够修改 information_schema(这应该是不可能的,并且在 MySQL 中,但 SQL 的其他供应商实现可能允许),您至少应该选择不这样做。如果您可能损坏/修改information_schema,那么您就会损坏其他数据库的实际结构(例如表名、列类型)。
每个用户都有自己的 information_schema 副本吗?
每个用户都可以看到与他们有权访问的表和数据库相关的 information_schema。一些权限严重受限的用户仍会看到 information_schema,但对于任何 information_schema 查询只能看到 NULL 值。然而,重要的是要记住,information_schema 不是一个实际的数据库,而只是 SQL 提供的一种方便的方式,以便您可以选择有关数据库和表的信息。
来自参考文档:
我在哪里可以找到更多信息?
You can think of information_schema as a "master database" that holds details about all the other databases on the server such as the names and types of tables, columns and users.
What is information_schema?
From the reference documentation:
What is stored in information_schema?
You can see the kinds of things stored in information_schema, and the way in which they are organised, by viewing this diagram (for MySQL 5.0) or this diagram (for MySQL 5.1).
What happens if I modify information_schema?
In reality, information_schema is a collection of read-only views. As such, it should be impossible to modify it and do any damage. However, the MySQL FAQ on this topic has this to say:
This implies that if you do find yourself able to modify information_schema (which should be impossible, and is in MySQL, but other vendor implementations of SQL might allow it) you should at the very least choose not to. If you could damage/modify information_schema you'd be damaging the actual structure (e.g. table names, column types) of your other databases.
Does every user have their own copy of information_schema?
Each user can see information_schema that pertains to the tables and databases they have access to. Some users with heavily limited rights will still see information_schema but will see only NULL values for any information_schema queries. However, it is important to remember that information_schema is not an actual database, but simply a convenient way SQL provides so that you can select information about your database(s) and table(s).
From the reference documentation:
Where can I find more information?