2.3.3.5 MySQLInstallerConsole 参考

MySQLInstallerConsole.exe提供类似于 MySQL Installer 的命令行功能。最初执行 MySQL Installer 后安装,然后在MySQL Installer目录中可用。通常,它位于C:\Program Files (x86)\MySQL\MySQL Installer\中,并且必须以 Management 特权执行控制台。

若要使用,请通过选择“开始”,“附件”来调用具有 Management 特权的命令提示符,然后右键单击“命令提示符”并选择Run as administrator。然后从命令行将目录更改为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.

MySQLInstallerConsole.exe支持以下命令:

Note

包含冒号(“:”)的配置块值必须用双引号引起来。例如,installdir =“ C:\ MySQL\MySQL Server 8.0”。

在系统上配置一个或多个 MySQL 产品。可以为每个产品配置多个设置值对。

Switches include:

C:\> MySQLInstallerConsole configure -showsettings server
C:\> MySQLInstallerConsole configure server:port=3307

显示带有用法示例的帮助消息,然后退出。传递其他命令以获取特定于该命令的帮助。

C:\> MySQLInstallerConsole help
C:\> MySQLInstallerConsole help install

在系统上安装一个或多个 MySQL 产品。如果有预发布产品,则当-type开关的值为DeveloperClientFull时,将同时安装 GA 和预发布产品。仅当使用这些设置类型时,才使用-only_ga_products开关将产品集限制为 GA 产品。

开关和语法选项包括:

Note

仅当未安装其他 MySQL 产品时才能选择非自定义安装类型。

包含冒号(:)的配置块值必须用双引号引起来。例如installdir="C:\MySQL\MySQL Server 8.0"

每个产品只能定义一个“ config”类型块。应该为在产品安装期间创建的每个用户定义一个“用户”块。

Note

重新配置产品时,不支持添加用户。

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

传递附加配置块(以^分隔以适合)的示例:

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

列出一个交互式控制台,可以在其中搜索所有可用的 MySQL 产品。执行MySQLInstallerConsole list以启动控制台,然后 Importing 子字符串进行搜索。

C:\> MySQLInstallerConsole list

修改或显示以前安装的 MySQL 产品的功能。

C:\> MySQLInstallerConsole modify server
C:\> MySQLInstallerConsole modify server:+documentation
C:\> MySQLInstallerConsole modify server:-debug

从系统中删除一种或多种产品。

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

快速概述系统上安装的 MySQL 产品。信息包括产品名称和版本,体系结构,安装日期和安装位置。

C:\> MySQLInstallerConsole status

将最新的 MySQL 产品目录下载到您的系统。成功后,将在下一次执行 MySQLInstaller 或 MySQLInstallerConsole 时应用下载目录。

C:\> MySQLInstallerConsole update

Note

“自动目录更新 GUI”选项从 Windows Task Scheduler 执行此命令。

在系统上升级一个或多个产品。语法选项包括:

C:\> MySQLInstallerConsole upgrade *
C:\> MySQLInstallerConsole upgrade workbench:6.3.5
C:\> MySQLInstallerConsole upgrade workbench:!
C:\> MySQLInstallerConsole upgrade workbench:6.3.5 excel:1.3.2
首页