2.3.3.5 MySQLInstallerConsole Reference参考

MySQLInstallerConsole.exe provides command-line functionality that is similar to MySQL Installer. 提供了类似于MySQL安装程序的命令行功能。It is installed when MySQL Installer is initially executed and then available within the MySQL Installer for Windows directory. 它是在最初执行MySQL安装程序时安装的,然后在MySQL Installer for Windows目录中可用。By default, that is in C:\Program Files (x86)\MySQL\MySQL Installer for Windows, and the console must be executed with administrative privileges.默认情况下,位于C:\Program Files (x86)\MySQL\MySQL Installer for Windows中,控制台必须以管理权限执行。

To use, invoke the command prompt with administrative privileges by choosing Start, Accessories, then right-click on Command Prompt and choose Run as administrator. 要使用,请使用管理权限调用命令提示符,方法是选择“开始”、“附件”,然后右键单击“命令提示符”并选择“以管理员身份运行”。And from the command line, optionally change the directory to where MySQLInstallerConsole.exe is located:从命令行中,可以选择将目录更改为MySQLInstallerConsole.exe所在的位置:

C:\> cd Program Files (x86)\MySQL\MySQL Installer for Windows
C:\Program Files (x86)\MySQL\MySQL Installer for Windows> MySQLInstallerConsole.exe help
=================== Start Initialization ===================
MySQL Installer is running in Community mode

Attempting to update manifest.
Initializing product requirements
Loading product catalog
Checking for product catalog snippets
Checking for product packages in the bundle
Categorizing product catalog
Finding all installed packages.
Your product catalog was last updated at 11/1/2016 4:10:38 PM
=================== End Initialization ===================

The following commands are available:

Configure - Configures one or more of your installed programs.
Help      - Provides list of available commands.
Install   - Install and configure one or more available MySQL programs.
List      - Provides an interactive way to list all products available.
Modify    - Modifies the features of installed products.
Remove    - Removes one or more products from your system.
Status    - Shows the status of all installed products.
Update    - Update the current product catalog.
Upgrade   - Upgrades one or more of your installed programs.
MySQL Product NamesMySQL产品名称

Many of the MySQLInstallerConsole commands accept one or more keywords that represent a MySQL product (or products) in the catalog. 许多MySQLInstallerConsole命令接受一个或多个关键字,这些关键字表示目录中的MySQL产品。The current set of valid keywords for use with commands is shown in the following table.下表显示了用于命令的当前有效关键字集。

Table 2.6 MySQL Product Keywords for MySQLInstallerConsole表2.6 MySQLInstallerConsole的MySQL产品关键字

KeywordMySQL ProductMySQL产品
serverMySQL Server
workbenchMySQL Workbench
shellMySQL Shell
visualMySQL for Visual Studio
routerMySQL Router
backupMySQL Enterprise Backup
netMySQL Connector/NET
odbcMySQL Connector/ODBC
c++MySQL Connector/C++
pythonMySQL Connector/Python
jMySQL Connector/J
documentationMySQL Server DocumentationMySQL Server文档
samplesMySQL Samples (sakila and world databases)MySQL示例(sakila和world数据库)

MySQLInstallerConsole Command Options命令选项

MySQLInstallerConsole.exe supports the following command options:支持以下命令选项:

Note注意

Configuration block values that contain a colon character (:) must be wrapped in quotation marks. 包含冒号(:)的配置块值必须用引号括起来。For example, installdir="C:\MySQL\MySQL Server 8.0".例如:installdir="C:\MySQL\MySQL Server 8.0"

  • configure [product1]:[setting]=[value]; [product2]:[setting]=[value]; [...]

    Configures one or more MySQL products on your system. Multiple setting=value pairs can be configured for each product.在系统上配置一个或多个MySQL产品。可以为每个产品配置多个设置=值对。

    Switches include:交换机包括:

    -showsettings

    Displays the available options for the selected product, by passing in the product name after -showsettings.通过在-showsettings之后传递产品名称,显示所选产品的可用选项。

    -silent

    Disables confirmation prompts.禁用确认提示。

    C:\> MySQLInstallerConsole configure -showsettings server
    C:\> MySQLInstallerConsole configure server:port=3307
  • help [command]

    Displays a help message with usage examples and then exits. Pass in an additional command to receive help specific to that command.显示带有用法示例的帮助消息,然后退出。传入一个附加命令以接收特定于该命令的帮助。

    C:\> MySQLInstallerConsole help
    C:\> MySQLInstallerConsole help install
  • install [product]:[features]:[config block]:[config block]:[config block]; [...]

    Installs one or more MySQL products on your system. 在您的系统上安装一个或多个MySQL产品。If pre-release products are available, both GA and pre-release products are installed when the value of the -type switch is Developer, Client, or Full. 如果预发布产品可用,则当-type开关的值为DeveloperClientFull时,将同时安装GA和预发布产品。Use the -only_ga_products switch to restrict the product set to GA products only when using these setup types.仅当使用这些设置类型时,使用-only_ga_products开关将产品集限制为ga产品。

    Switches and syntax options include:开关和语法选项包括:

    -only_ga_products

    Restricts the product set to include GA products only.将产品集限制为仅包括GA产品。

    -type=[SetupType]

    Installs a predefined set of software. The setup type can be one of the following:安装一组预定义的软件。设置类型可以是以下类型之一:

    • Developer: Installs a complete development environment.:安装一个完整的开发环境。

    • Server: Installs a single MySQL server:安装单个MySQL服务器

    • Client: Installs client programs and libraries:安装客户端程序和库

    • Full: Installs everything:安装所有内容

    • Custom: Installs user-selected products. This is the default option.:安装用户选择的产品。这是默认选项。

    Note注意

    Non-custom setup types are valid only when no other MySQL products are installed.只有在没有安装其他MySQL产品的情况下,非自定义设置类型才有效。

    -showsettings

    Displays the available options for the selected product, by passing in the product name after -showsettings.通过在-showsettings之后传递产品名称,显示所选产品的可用选项。

    -silent

    Disable confirmation prompts.禁用确认提示。

    [product]

    Each product can be specified by a product keyword with or without a semicolon-separated version qualifier. 每个产品都可以由带有或不带有分号分隔的版本限定符的产品关键字指定。Passing in a product keyword alone selects the latest version of the product. 仅传入一个产品关键字就可以选择产品的最新版本。If multiple architectures are available for that version of the product, the command returns the first one in the manifest list for interactive confirmation. 如果该版本的产品有多个体系结构可用,则该命令返回清单列表中的第一个体系结构以进行交互式确认。Alternatively, you can pass in the exact version and architecture (x86 or x64) after the product keyword using the -silent switch.或者,您可以使用-silent开关在产品关键字后面传递确切的版本和体系结构(x86x64)。

    [features]

    All features associated with a MySQL product are installed by default. 默认情况下,将安装与MySQL产品相关的所有功能。The feature block is a semicolon-separated list of features or an asterisk character (*) that selects all features. 要素块是以分号分隔的要素列表,或者是选择所有要素的星号(*)。To remove a feature, use the modify command.要删除特征,请使用modify命令。

    [config block]

    One or more configuration blocks can be specified. 可以指定一个或多个配置块。Each configuration block is a semicolon-separated list of key-value pairs. 每个配置块都是一个以分号分隔的键值对列表。A block can include either a config or user type key; config is the default type if one is not defined.一个块可以包括config类型键或user类型键;config是默认类型(如果未定义)。

    Configuration block values that contain a colon character (:) must be wrapped in quotation marks. For example, installdir="C:\MySQL\MySQL Server 8.0". 包含冒号(:)的配置块值必须用引号括起来。例如,installdir="C:\MySQL\MySQL Server 8.0"Only one configuration type block can be defined for each product. 每个产品只能定义一个配置类型块。A user block should be defined for each user to be created during the product installation.应为产品安装期间要创建的每个用户定义一个用户块。

    Note注意

    The user type key is not supported when a product is being reconfigured.重新配置产品时不支持user类型密钥。

    C:\> MySQLInstallerConsole install server;5.6.25:*:port=3307;serverid=2:type=user;username=foo;password=bar;role=DBManager
    C:\> MySQLInstallerConsole install server;5.6.25;x64 -silent

    An example that passes in additional configuration blocks, separated by ^ to fit:传入附加配置块的示例,用^分隔以适合:

    C:\> MySQLInstallerConsole install server;5.6.25;x64:*:type=config;openfirewall=true; ^
              generallog=true;binlog=true;serverid=3306;enable_tcpip=true;port=3306;rootpasswd=pass; ^
              installdir="C:\MySQL\MySQL Server 5.6":type=user;datadir="C:\MySQL\data";username=foo;password=bar;role=DBManager
  • list

    Lists an interactive console where all of the available MySQL products can be searched. Execute MySQLInstallerConsole list to launch the console and enter in a substring to search.列出一个交互式控制台,可以在其中搜索所有可用的MySQL产品。执行MySQLInstallerConsole list以启动控制台并输入要搜索的子字符串。

    C:\> MySQLInstallerConsole list
  • modify [product1:-removelist|+addlist] [product2:-removelist|+addlist] [...]

    Modifies or displays features of a previously installed MySQL product. To display the features of a product, append the product keyword to the command, for example:修改或显示以前安装的MySQL产品的功能。要显示产品的功能,请将product关键字附加到命令中,例如:

    C:\> MySQLInstallerConsole modify server

    The syntax option for this command:此命令的语法选项:

    -silent

    Disable confirmation prompts.禁用确认提示。

    C:\> MySQLInstallerConsole modify server:+documentation
    C:\> MySQLInstallerConsole modify server:-debug
  • remove [product1] [product2] [...]

    Removes one ore more products from your system. Switches and syntax options include:从系统中删除一个或多个产品。开关和语法选项包括:

    *

    Pass in * to remove all of the MySQL products.传入*以删除所有MySQL产品。

    -continue

    Continue the operation even if an error occurs.即使出现错误,也要继续操作。

    -silent

    Disable confirmation prompts.禁用确认提示。

    C:\> MySQLInstallerConsole remove *
    C:\> MySQLInstallerConsole remove server
  • status

    Provides a quick overview of the MySQL products that are installed on the system. Information includes product name and version, architecture, date installed, and install location.提供系统上安装的MySQL产品的快速概述。信息包括产品名称和版本、体系结构、安装日期和安装位置。

    C:\> MySQLInstallerConsole status
  • update

    Downloads the latest MySQL product catalog to your system. 将最新的MySQL产品目录下载到您的系统中。On success, the catalog is applied the next time either MySQLInstaller or MySQLInstallerConsole is executed.成功后,将在下次执行MySQLInstallerMySQLInstallerConsole时应用目录。

    C:\> MySQLInstallerConsole update
    Note注意

    The Automatic Catalog Update GUI option executes this command from the Windows Task Scheduler.“自动目录更新GUI”选项从Windows任务计划程序执行此命令。

  • upgrade [product1:version] [product2:version] [...]

    Upgrades one or more products on your system. Syntax options include:升级系统上的一个或多个产品。语法选项包括:

    *

    Pass in * to upgrade all products to the latest version, or pass in specific products.传入*可将所有产品升级到最新版本,或传入特定产品。

    !

    Pass in ! as a version number to upgrade the MySQL product to its latest version.传入!作为将MySQL产品升级到其最新版本的版本号。

    -silent

    Disable confirmation prompts.禁用确认提示。

    C:\> MySQLInstallerConsole upgrade *
    C:\> MySQLInstallerConsole upgrade workbench:8.0.21
    C:\> MySQLInstallerConsole upgrade workbench:!
    C:\> MySQLInstallerConsole upgrade workbench:8.0.21 visual:1.2.9