2.3.3.3.2 MySQL Router Configuration with MySQL Installer使用MySQL安装程序配置MySQL路由器

MySQL Installer downloads and installs a suite of tools for developing and managing business-critical applications on Windows. The suite consists of applications, connectors, documentation, and samples.MySQL安装程序下载并安装一套工具,用于在Windows上开发和管理业务关键型应用程序。该套件由应用程序、连接器、文档和示例组成。

During the initial setup, choose any predetermined setup type, except Server only, to install the latest GA version of the tools. 初始设置过程中,选择任何预定的设置类型(除了Server only),以安装工具的最新GA版本。Use the Custom setup type to install an individual tool or specific version. 使用Custom设置类型安装单个工具或特定版本。If MySQL Installer is installed on the host already, use the Add operation to select and install tools from the MySQL Installer dashboard.如果主机上已经安装了MySQL安装程序,请使用“添加”操作从MySQL安装程序面板中选择并安装工具。

MySQL Router ConfigurationMySQL路由器配置

MySQL Installer provides a configuration wizard that can bootstrap an installed instance of MySQL Router 8.0 to direct traffic between MySQL applications and an InnoDB Cluster. When configured, MySQL Router runs as a local Windows service.MySQL安装程序提供了一个配置向导,可以引导已安装的MySQL Router 8.0实例,以引导MySQL应用程序和InnoDB集群之间的流量。配置后,MySQL路由器将作为本地Windows服务运行。

Note注意

You are prompted to configure MySQL Router after the initial installation and when you reconfigure an installed router explicitly. In contrast, the upgrade operation does not require or prompt you to configure the upgraded product.在初次安装后以及显式重新配置已安装的路由器时,系统会提示您配置MySQL路由器。相比之下,升级操作不需要或不提示您配置升级后的产品。

To configure MySQL Router, do the following:要配置MySQL路由器,请执行以下操作:

  1. Set up InnoDB Cluster.设置InnoDB集群。

  2. Using MySQL Installer, download and install the MySQL Router application. After the installation finishes, the configuration wizard prompts you for information. 使用MySQL安装程序,下载并安装MySQL路由器应用程序。安装完成后,配置向导会提示您提供信息。Select the Configure MySQL Router for InnoDB Cluster check box to begin the configuration and provide the following configuration values:选中“为InnoDB集群配置MySQL路由”复选框开始配置并提供以下配置值:

    • Hostname:主机名: Host name of the primary (seed) server in the InnoDB Cluster (localhost by default).InnoDB集群中主(种子)服务器的主机名(默认为localhost)。

    • Port:端口: The port number of the primary (seed) server in the InnoDB Cluster (3306 by default).InnoDB集群中主(种子)服务器的端口号(默认为3306)。

    • Management User:管理用户: An administrative user with root-level privileges.具有根级别权限的管理用户。

    • Password:密码: The password for the management user.管理用户的密码。

    • Classic MySQL protocol connections to InnoDB ClusterInnoDB集群的经典MySQL协议连接

      Read/Write:读/写: Set the first base port number to one that is unused (between 80 and 65532) and the wizard will select the remaining ports for you.将第一个基本端口号设置为未使用的端口号(介于80和65532之间),向导将为您选择其余端口。

      The figure that follows shows an example of the MySQL Router configuration page, with the first base port number specified as 6446 and the remaining ports set by the wizard to 6447, 6448, and 6449.下图显示了MySQL路由器配置页面的示例,第一个基本端口号指定为6446,其余端口由向导设置为6447、6448和6449。

    Figure 2.10 MySQL Router Configuration图2.10 MySQL路由器配置

    Content is described in the surrounding text.

  3. Click Next and then Execute to apply the configuration. 单击“下一步”,然后单击“执行”以应用配置。Click Finish to close MySQL Installer or return to the MySQL Installer dashboard.单击“完成”关闭MySQL安装程序或返回到MySQL安装程序面板

After configuring MySQL Router, the root account exists in the user table as root@localhost (local) only, instead of root@% (remote). 配置MySQL路由器后,根帐户在用户表中的存在方式为root@localhost仅限(本地),而不是root@%(远程)。Regardless of where the router and client are located, even if both are located on the same host as the seed server, any connection that passes through the router is viewed by server as being remote, not local. As a result, a connection made to the server using the local host (see the example that follows), does not authenticate.无论路由器和客户端位于何处,即使两者与种子服务器位于同一主机上,通过路由器的任何连接都会被服务器视为远程连接,而不是本地连接。因此,使用本地主机(请参阅下面的示例)与服务器建立的连接不会进行身份验证。

shell> \c root@localhost:6446