8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

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

22.4.2 下载并导入 world_x 数据库22.4.2 Download and Import world_x Database

作为本快速入门指南的一部分,提供了一个示例模式,该模式称为 world_x 模式。许多示例使用此模式演示文档存储功能。启动您的 MySQL 服务器以便加载 world_x 模式,然后按照以下步骤操作:As part of this quick-start guide, an example schema is provided which is referred to as the world_x schema. Many of the examples demonstrate Document Store functionality using this schema. Start your MySQL server so that you can load the world_x schema, then follow these steps:

  1. 下载 world_x-db.zip。Download world_x-db.zip.

  2. 将安装归档文件解压到临时位置,例如 /tmp/。解压归档文件会生成一个名为 world_x.sql 的文件。Extract the installation archive to a temporary location such as /tmp/. Unpacking the archive results in a single file named world_x.sql.

  3. 将 world_x.sql 文件导入到您的服务器。您可以选择:Import the world_x.sql file to your server. You can either:

    • 以 SQL 模式启动 MySQL Shell,并通过执行以下命令导入该文件:Start MySQL Shell in SQL mode and import the file by issuing:

      mysqlsh -u root --sql --file /tmp/world_x-db/world_x.sql
      Enter password: ****
      
    • 在 MySQL Shell 运行时,将其设置为 SQL 模式,并通过执行以下命令导入 schema 文件:Set MySQL Shell to SQL mode while it is running and source the schema file by issuing:

      \sql
      Switching to SQL mode... Commands end with ;
      \source /tmp/world_x-db/world_x.sql
      

    将 /tmp/ 替换为系统中 world_x.sql 文件的路径。如果提示,请输入密码。只要账户具有创建新 schema 的权限,就可以使用非 root 账户。Replace /tmp/ with the path to the world_x.sql file on your system. Enter your password if prompted. A non-root account can be used as long as the account has privileges to create new schemas.

world_x 架构The world_x Schema

world_x 示例 schema 包含以下 JSON 集合和关系表:The world_x example schema contains the following JSON collection and relational tables:

  • 集合Collection

    • countryinfo:关于世界各国的信息。countryinfo: Information about countries in the world.

  • 表格Tables

    • country:关于世界各国的最基本信息。country: Minimal information about countries of the world.

    • city:关于这些国家的一些城市的信息。city: Information about some of the cities in those countries.

    • countrylanguage:每个国家使用的语言。countrylanguage: Languages spoken in each country.

相关信息Related Information