简体   繁体   English

MariaDB / MySQL预先存在的数据库

[英]MariaDB / MySQL pre-existing DB's

I was wondering what these three pre-existing Database are for? 我想知道这三个现有数据库的用途是什么?

information_schema
mysql
performance_schema

I am interested to know whether or not I can remove them in a minimalistic environment without worrying about any ramifications. 我很想知道是否可以在简约的环境中删除它们而不必担心任何后果。

Mysql will foolishly allow you to drop mysql and performance_schema but not information schema. Mysql将愚蠢地允许您删除mysql和performance_schema,但不允许删除信息架构。 However, You SHOULD NOT remove these Database because Mysql will stop function properly. 但是,您不应删除这些数据库,因为Mysql将停止正常运行。

For example if you remove the mysql database, you will still be able to log in as root and run 'show databases; 例如,如果您删除mysql数据库,您仍将能够以root用户身份登录并运行'show databases; but if you try to run show tables; 但是如果您尝试运行show tables; in a database, You will get an empty set. 在数据库中,您将获得一个空集。

You can, however,restrict who sees them based on user permissions and grants. 但是,您可以根据用户权限和授予来限制谁看到它们。

From dev.mysql : dev.mysql

Tables in the performance_schema database are a collection of views and temporary tables that do not store data permanently. performance_schema数据库中的表是视图和临时表的集合,这些视图和临时表不会永久存储数据。

The Performance Schema provides a way to inspect internal execution of the server at runtime. 性能模式提供了一种在运行时检查服务器内部执行的方法。 It is implemented using the PERFORMANCE_SCHEMA storage engine and the performance_schema database. 它是使用PERFORMANCE_SCHEMA存储引擎和performance_schema数据库实现的。 The Performance Schema focuses primarily on performance data. 性能模式主要关注性能数据。 This differs from INFORMATION_SCHEMA, which serves for inspection of metadata. 这与用来检查元数据的INFORMATION_SCHEMA不同。

You can run this command and get info about threads: 您可以运行以下命令并获取有关线程的信息:

select name, type, instrumented from performance_schema.threads;

From dev.mysql : dev.mysql

INFORMATION_SCHEMA is a database within each MySQL instance, the place that stores information about all the other databases that the MySQL server maintains. INFORMATION_SCHEMA是每个MySQL实例中的一个数据库,该位置存储有关MySQL服务器维护的所有其他数据库的信息。 The INFORMATION_SCHEMA database contains several read-only tables. INFORMATION_SCHEMA数据库包含几个只读表。 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. 另外,没有使用该名称的数据库目录。

You can run this command to see which databases have MyISAM Tables: 您可以运行以下命令来查看哪些数据库具有MyISAM表:

select distinct(table_schema) FROM information_schema.tables where engine = 'MyISAM';

From dev.mysql . 来自dev.mysql

The mysql system database includes several grant tables that contain information about user accounts and the privileges held by them. mysql系统数据库包括几个授权表,这些表包含有关用户帐户及其所拥有特权的信息。

You can run this command to see a list of users and host: 您可以运行以下命令来查看用户和主机的列表:

select user, host from mysql.user;

You can't remove these databases. 您无法删除这些数据库。 If you alter tables or otherwise change things in them you may corrupt your server. 如果更改表或以其他方式更改表中的内容,则可能会损坏服务器。

They are "fake" databases, used for metadata. 它们是用于元数据的“伪”数据库。 They don't take much space. 他们不占用太多空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rake:db迁移失败,并带有预先存在的mySQL数据库 - Rake:db migrate failing with pre-existing mySQL database 使用Vagrant / VirtualBox预先存在的MySQL数据 - Pre-existing MySQL data with Vagrant / VirtualBox 将预先存在的数据库上的多对多渴望加载序列化 - Sequelize Many-to-Many eager loading on pre-existing DB 如何索引MySQL中预先存在的数据? - How do I index pre-existing data in MySQL? Django-访问mySQL数据库中的预先存在的数据 - Django - Access pre-existing data in mySQL database 具有预先存在的MySQL数据库的模式转储导致NoMethodError - Schema dump with pre-existing MySQL database results in NoMethodError 编辑mysql数据库表中的现有数据 - Edit pre-existing data in a mysql database table 将辅助数据输入到现有数据库中 - Entering secondary data into pre-existing database 我应该如何将LoopBack Framework应用程序连接到预先存在/已填充数据的MySQL数据库/数据源? - How should I connect a LoopBack Framework app to a Pre-Existing / Data Filled MySQL Database / Data Source? Rails和预先存在的MySQL数据库:是否有简单的方法将数据库结构集成到Active Record中? - Rails & Pre-existing MySQL Database: Is there an easy way to integrate database structure into Active Record?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM