8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

10.12.2 使用符号链接10.12.2 Using Symbolic Links

您可以将数据库或表从数据库目录移动到其他位置,并用指向新位置的符号链接替换它们。例如,您可能想这样做,以将数据库移动到拥有更多可用空间的文件系统,或者通过将表分散到不同的磁盘上来提高系统速度。You can move databases or tables from the database directory to other locations and replace them with symbolic links to the new locations. You might want to do this, for example, to move a database to a file system with more free space or increase the speed of your system by spreading your tables to different disks.

对于 InnoDB 表,请使用 DATA DIRECTORY 语句的 CREATE TABLE 子句,而不是使用符号链接,如 第 17.6.1.2 节,“在外部创建表” 所述。这项新功能是一种受支持的、跨平台的技术。For InnoDB tables, use the DATA DIRECTORY clause of the CREATE TABLE statement instead of symbolic links, as explained in Section 17.6.1.2, “Creating Tables Externally”. This new feature is a supported, cross-platform technique.

推荐的方法是将整个数据库目录符号链接到不同的磁盘。仅在万不得已的情况下才为 MyISAM 表创建符号链接。The recommended way to do this is to symlink entire database directories to a different disk. Symlink MyISAM tables only as a last resort.

要确定您的数据目录的位置,请使用以下语句:To determine the location of your data directory, use this statement:

SHOW VARIABLES LIKE 'datadir';