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安装程序时安装的,然后在MySQL Installer for Windows
directory. 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 要使用,请使用管理权限调用命令提示符,方法是选择“开始”、“附件”,然后右键单击“命令提示符”并选择“以管理员身份运行”。 , , then right-click on 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.
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产品关键字
Keyword | |
---|---|
server | MySQL Server |
workbench | MySQL Workbench |
shell | MySQL Shell |
visual | MySQL for Visual Studio |
router | MySQL Router |
backup | MySQL Enterprise Backup |
net | MySQL Connector/NET |
odbc | MySQL Connector/ODBC |
c++ | MySQL Connector/C++ |
python | MySQL Connector/Python |
j | MySQL Connector/J |
documentation | |
samples |
MySQLInstallerConsole.exe supports the following command options:支持以下命令选项:
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
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
开关的值为Developer
、Client
或Full
时,将同时安装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.:安装用户选择的产品。这是默认选项。
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
开关在产品关键字后面传递确切的版本和体系结构(x86
或x64
)。
[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.应为产品安装期间要创建的每个用户定义一个用户块。
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
Lists an interactive console where all of the available MySQL products can be searched. Execute 列出一个交互式控制台,可以在其中搜索所有可用的MySQL产品。执行MySQLInstallerConsole list
to launch the console and enter in a substring to search.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
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
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.MySQLInstaller
或MySQLInstallerConsole
时应用目录。
C:\> MySQLInstallerConsole update
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