由 MySQL 服务器管理的信息存储在称为数据目录的目录下。以下列表简要描述了数据目录中通常找到的项目,并提供了额外信息的交叉引用:Information managed by the MySQL server is stored under a directory known as the data directory. The following list briefly describes the items typically found in the data directory, with cross references for additional information:
数据目录子目录。数据目录的每个子目录都是一个数据库目录,并对应于服务器管理的一个数据库。所有 MySQL 安装都有某些标准数据库:Data directory subdirectories. Each subdirectory of the data directory is a database directory and corresponds to a database managed by the server. All MySQL installations have certain standard databases:
mysql目录对应于mysql系统模式,其中包含 MySQL 服务器运行时所需的信息。该数据库包含数据字典表和系统表。参见 第 7.3 节,“mysql 系统模式”。Themysqldirectory corresponds to themysqlsystem schema, which contains information required by the MySQL server as it runs. This database contains data dictionary tables and system tables. See Section 7.3, “The mysql System Schema”.performance_schema目录对应于性能模式,它提供用于检查服务器在运行时内部执行的信息。参见 第 29 章,MySQL 性能模式。Theperformance_schemadirectory corresponds to the Performance Schema, which provides information used to inspect the internal execution of the server at runtime. See Chapter 29, MySQL Performance Schema.sys目录对应sys模式,它提供了一组对象以帮助更轻松地解释 Performance Schema 信息。见 第 30 章,MySQL sys 模式。Thesysdirectory corresponds to thesysschema, which provides a set of objects to help interpret Performance Schema information more easily. See Chapter 30, MySQL sys Schema.ndbinfo目录对应ndbinfo数据库,存储 NDB Cluster 特有的信息(仅存在于包含 NDB Cluster 的安装中)。见 第 25.6.15 节,“ndbinfo:NDB Cluster 信息数据库”。Thendbinfodirectory corresponds to thendbinfodatabase that stores information specific to NDB Cluster (present only for installations built to include NDB Cluster). See Section 25.6.15, “ndbinfo: The NDB Cluster Information Database”.
其他子目录对应用户或应用程序创建的数据库。Other subdirectories correspond to databases created by users or applications.
NoteINFORMATION_SCHEMA是一个标准数据库,但其实现没有使用相应的数据库目录。INFORMATION_SCHEMAis a standard database, but its implementation uses no corresponding database directory.由服务器写入的日志文件。参见 第 7.4 节,“MySQL 服务器日志”。Log files written by the server. See Section 7.4, “MySQL Server Logs”.
InnoDB表空间和日志文件。参见 第 17 章,InnoDB 存储引擎。InnoDBtablespace and log files. See Chapter 17, The InnoDB Storage Engine.默认/自动生成的 SSL 和 RSA 证书及密钥文件。参见 第 8.3.3 节,“创建 SSL 和 RSA 证书及密钥”。Default/autogenerated SSL and RSA certificate and key files. See Section 8.3.3, “Creating SSL and RSA Certificates and Keys”.
服务器进程 ID 文件(服务器运行时)。The server process ID file (while the server is running).
mysqld-auto.cnf文件用于存储持久化的全局系统变量设置。参见 第 15.7.6.1 节,“SET 语法用于变量赋值”。Themysqld-auto.cnffile that stores persisted global system variable settings. See Section 15.7.6.1, “SET Syntax for Variable Assignment”.
前面列表中的某些项目可以通过重新配置服务器将其移动到其他位置。此外,--datadir 选项可以更改数据目录本身的位置。对于给定的 MySQL 安装,请检查服务器配置以确定项目是否已被移动。Some items in the preceding list can be relocated elsewhere by
reconfiguring the server. In addition, the
--datadir option enables the
location of the data directory itself to be changed. For a given
MySQL installation, check the server configuration to determine
whether items have been moved.