10bet网址
MySQL 5.7 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual

2.3.3.3 Installation Workflows with MySQL Installer

MySQL Installer provides a wizard-like tool to install and configure new MySQL products for Windows. Unlike the initial setup, which runs only once, MySQL Installer invokes the wizard each time you download or install a new product. For first-time installations, the steps of the initial setup proceed directly into the steps of the installation. For assistance with product selection, seeLocating Products to Install.

Note

Full permissions are granted to the user executing MySQL Installer to all generated files, such asmy.ini. This does not apply to files and directories for specific products, such as the MySQL server data directory in%ProgramData%that is owned bySYSTEM.

Products installed and configured on a host follow a general pattern that might require your input during the various steps. If you attempt to install a product that is incompatible with the existing MySQL server version (or a version selected for upgrade), you are alerted about the possible mismatch.

MySQL Installer provides the following sequence of actions that apply to different workflows:

  • Select Products.If you selected theCustomsetup type during the initial setup or clickedAddfrom theMySQL Installer dashboard, MySQL Installer includes this action in the sidebar. From this page, you can apply a filter to modify the Available Products list and then select one or more products to move (using arrow keys) to the Products To Be Installed list.

    Select the check box on this page to activate the Select Features action where you can customize the products features after the product is downloaded.

  • Download.If you installed the full (not web) MySQL Installer package, all.msifiles were loaded to theProduct Cachefolder during the initial setup and are not downloaded again. Otherwise, clickExecuteto begin the download. The status of each product changes fromReady to Download, toDownloading, and then toDownloaded.

  • Select Features To Install (disabled by default).After MySQL Installer downloads a product's.msifile, you can customize the features if you enabled the optional check box previously during the Select Products action.

    To customize product features after the installation, clickModifyin theMySQL Installer dashboard.

  • Installation.The status of each product in the list changes fromReady to Install, toInstalling, and lastly toComplete. During the process, clickShow Detailsto view the installation actions.

    If you cancel the installation at this point, the products are installed, but the server (if installed) is not yet configured. To restart the server configuration, open MySQL Installer from the Start menu and clickReconfigurenext to the appropriate server in the dashboard.

  • Product configuration.This step applies to MySQL Server, MySQL Router, and samples only. The status for each item in the list should indicateReady to Configure. ClickNextto start the configuration wizard for all items in the list. The configuration options presented during this step are specific to the version of database or router that you selected to install.

    ClickExecuteto begin applying the configuration options or clickBack(repeatedly) to return to each configuration page.

  • Installation complete.This step finalizes the installation for products that do not require configuration. It enables you to copy the log to a clipboard and to start certain applications, such as MySQL Workbench and MySQL Shell. ClickFinishto open theMySQL Installer dashboard.

2.3.3.3.1 MySQL Server Configuration with MySQL Installer

MySQL Installer performs the initial configuration of the MySQL server. For example:

  • It creates the configuration file (my.ini) that is used to configure the MySQL server. The values written to this file are influenced by choices you make during the installation process. Some definitions are host dependent. For example, query_cache is enabled if the host has fewer than three cores.

    Note

    Query cache was deprecated in MySQL 5.7 and removed in MySQL 8.0 (and later).

  • By default, a Windows service for the MySQL server is added.

  • Provides default installation and data paths for MySQL server. For instructions on how to change the default paths, seeSection 2.3.3.2, “Setting Alternative Server Paths with MySQL Installer”.

  • It can optionally create MySQL server user accounts with configurable permissions based on general roles, such as DB Administrator, DB Designer, and Backup Admin. It optionally creates a Windows user namedMysqlSyswith limited privileges, which would then run the MySQL Server.

    User accounts may also be added and configured in MySQL Workbench.

  • CheckingShow Advanced Optionsenables additionalLogging Optionsto be set. This includes defining custom file paths for the error log, general log, slow query log (including the configuration of seconds it requires to execute a query), and the binary log.

During the configuration process, clickNextto proceed to the next step orBackto return to the previous step. ClickExecuteat the final step to apply the server configuration.

The sections that follow describe the server configuration options that apply to MySQL server on Windows. The server version you installed will determine which steps and options you can configure. Configuring MySQL server may include some or all of the steps.

2.3.3.3.1.1 Type and Networking
  • 服务公司er Configuration Type

    Choose the MySQL server configuration type that describes your setup. This setting defines the amount of system resources (memory) to assign to your MySQL server instance.

    • Development: A computer that hosts many other applications, and typically this is your personal workstation. This setting configures MySQL to use the least amount of memory.

    • 服务公司er: Several other applications are expected to run on this computer, such as a web server. The Server setting configures MySQL to use a medium amount of memory.

    • Dedicated: A computer that is dedicated to running the MySQL server. Because no other major applications run on this server, this setting configures MySQL to use the majority of available memory.

  • Connectivity

    Connectivity options control how the connection to MySQL is made. Options include:

    • TCP/IP: This option is selected by default. You may disable TCP/IP Networking to permit local host connections only. With the TCP/IP connection option selected, you can modify the following items:

      • Portfor classic MySQL protocol connections. The default value is3306.

      • X Protocol Portshown when configuring MySQL 8.0 server only. The default value is33060

      • Open Windows Firewall port for network access, which is selected by default for TCP/IP connections.

      If a port number is in use already, you will see the information icon () next to the default value andNextis disabled until you provide a new port number.

    • Named Pipe: Enable and define the pipe name, similar to setting thenamed_pipesystem variable. The default name isMySQL.

    • Shared Memory: Enable and define the memory name, similar to setting theshared_memorysystem variable. The default name isMySQL.

  • Advanced Configuration

    CheckShow Advanced and Logging Optionsto set custom logging and advanced options in later steps. The Logging Options step enables you to define custom file paths for the error log, general log, slow query log (including the configuration of seconds it requires to execute a query), and the binary log. The Advanced Options step enables you to set the unique server ID required when binary logging is enabled in a replication topology.

  • MySQL Enterprise Firewall (Enterprise Edition only)

    TheEnable MySQL Enterprise Firewallcheck box is deselected by default. Select this option to enable a security list that offers protection against certain types of attacks. Additional post-installation configuration is required (seeSection 6.4.6, “MySQL Enterprise Firewall”).

    Important

    There is an issue for MySQL 8.0.19 that prevents the server from starting if MySQL Enterprise Firewall is selected during the server configuration steps. If the server startup operation fails, clickCancelto end the configuration process and return to the dashboard. You must uninstall the server.

    解决方法是运行MySQL安装程序没有米ySQL Enterprise Firewall selected. (That is, do not select theEnable MySQL Enterprise Firewallcheck box.) Then install MySQL Enterprise Firewall afterward using the instructions for manual installation (seeSection 6.4.6.2, “Installing or Uninstalling MySQL Enterprise Firewall”).

2.3.3.3.1.2 Authentication Method

TheAuthentication Methodstep is visible only during the installation or upgrade of MySQL 8.0.4 or higher. It introduces a choice between two server-side authentication options. The MySQL user accounts that you create in the next step will use the authentication method that you select in this step.

MySQL 8.0 connectors and community drivers that uselibmysqlclient8.0 now support themysql_native_passworddefault authentication plugin. However, if you are unable to update your clients and applications to support this new authentication method, you can configure the MySQL server to usemysql_native_passwordfor legacy authentication. For more information about the implications of this change, seecaching_sha2_password as the Preferred Authentication Plugin.

If you are installing or upgrading to MySQL 8.0.4 or higher, select one of the following authentication methods:

  • Use Strong Password Encryption for Authentication (RECOMMENDED)

    MySQL 8.0 supports a new authentication based on improved, stronger SHA256-based password methods. It is recommended that all new MySQL server installations use this method going forward.

    Important

    Thecaching_sha2_passwordauthentication plugin on the server requires new versions of connectors and clients, which add support for the new MySQL 8.0 default authentication.

  • Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)

    Using the old MySQL 5.x legacy authentication method should be considered only in the following cases:

    • Applications cannot be updated to use MySQL 8.0 connectors and drivers.

    • Recompilation of an existing application is not feasible.

    • An updated, language-specific connector or driver is not available yet.

2.3.3.3.1.3 Accounts and Roles
  • Root Account Password

    Assigning a root password is required and you will be asked for it when performing other MySQL Installer operations. Password strength is evaluated when you repeat the password in the box provided. For descriptive information regarding password requirements or status, move your mouse pointer over the information icon () when it appears.

  • MySQL User Accounts (Optional)

    ClickAdd UserorEdit Userto create or modify MySQL user accounts with predefined roles. Next, enter the required account credentials:

    • User Name:MySQL user names can be up to 32 characters long.

    • Host:Selectlocalhostfor local connections only orwhen remote connections to the server are required.

    • Role:Each predefined role, such asDB Admin, is configured with its own set of privileges. For example, theDB Adminrole has more privileges than theDB Designerrole. TheRoledrop-down list contains a description of each role.

    • Password:Password strength assessment is performed while you type the password. Passwords must be confirmed. MySQL permits a blank or empty password (considered to be insecure).

    MySQL Installer Commercial Release Only:MySQL Enterprise Edition for Windows, a commercial product, also supports an authentication method that performs external authentication on Windows. Accounts authenticated by the Windows operating system can access the MySQL server without providing an additional password.

    To create a new MySQL account that uses Windows authentication, enter the user name and then select a value forHostandRole. ClickWindowsauthentication to enable theauthentication_windowsplugin. In the Windows Security Tokens area, enter a token for each Windows user (or group) who can authenticate with the MySQL user name. MySQL accounts can include security tokens for both local Windows users and Windows users that belong to a domain. Multiple security tokens are separated by the semicolon character (;) and use the following format for local and domain accounts:

    • Local account

      Enter the simple Windows user name as the security token for each local user or group; for example,finley;jeffrey;admin.

    • Domain account

      Use standard Windows syntax (domain\domainuser) or MySQL syntax (domain\\domainuser) to enter Windows domain users and groups.

      For domain accounts, you may need to use the credentials of an administrator within the domain if the account running MySQL Installer lacks the permissions to query the Active Directory. If this is the case, selectValidate Active Directory users withto activate the domain administrator credentials.

    Windows authentication permits you to test all of the security tokens each time you add or modify a token. ClickTest Security Tokens每个令牌验证(或重新验证)。无效的,kens generate a descriptive error message along with a redXicon and red token text. When all tokens resolve as valid (green text without anXicon), you can clickOKto save the changes.

2.3.3.3.1.4 Windows Service

On the Windows platform, MySQL server can run as a named service managed by the operating system and be configured to start up automatically when Windows starts. Alternatively, you can configure MySQL server to run as an executable program that requires manual configuration.

  • Configure MySQL server as a Windows service(Selected by default.)

    When the default configuration option is selected, you can also select the following:

    • Start the MySQL Server at System Startup

      When selected (default), the service startup type is set to Automatic; otherwise, the startup type is set to Manual.

    • Run Windows Service as

      WhenStandard System Accountis selected (default), the service logs on as Network Service.

      TheCustom Useroption must have privileges to log on to Microsoft Windows as a service. TheNextbutton will be disabled until this user is configured with the required privileges.

      A custom user account is configured in Windows by searching for "local security policy" in the Start menu. In the Local Security Policy window, selectLocal Policies,User Rights Assignment, and thenLog On As A Serviceto open the property dialog. ClickAdd User or Groupto add the custom user and then clickOKin each dialog to save the changes.

  • Deselect the Windows Service option

2.3.3.3.1.5 Logging Options

This step is available if theShow Advanced Configurationcheck box was selected during theType and Networkingstep. To enable this step now, clickBackto return to theType and Networkingstep and select the check box.

Advanced configuration options are related to the following MySQL log files:

Note

The binary log is enabled by default for MySQL 5.7 and higher.

2.3.3.3.1.6 Advanced Options

This step is available if theShow Advanced Configurationcheck box was selected during theType and Networkingstep. To enable this step now, clickBackto return to theType and Networkingstep and select the check box.

The advanced-configuration options include:

  • 服务公司er ID

    Set the unique identifier used in a replication topology. If binary logging is enabled, you must specify a server ID. The default ID value depends on the server version. For more information, see the description of theserver_idsystem variable.

  • Table Names Case

    You can set the following options during the initial and subsequent configuration the server. For the MySQL 8.0 release series, these options apply only to the initial configuration of the server.

    • Lower Case

      Sets thelower_case_table_namesoption value to 1 (default), in which table names are stored in lowercase on disk and comparisons are not case-sensitive.

    • Preserve Given Case

      Sets thelower_case_table_namesoption value to 2, in which table names are stored as given but compared in lowercase.

2.3.3.3.1.7 Apply Server Configuration

All configuration settings are applied to the MySQL server when you clickExecute. Use theConfiguration Stepstab to follow the progress of each action; the icon for each toggles from white to green (with a check mark) on success. Otherwise, the process stops and displays an error message if an individual action times out. Click theLogtab to view the log.

When the installation completes successfully and you clickFinish, MySQL Installer and the installed MySQL products are added to the Microsoft Windows Start menu under theMySQLgroup. Opening MySQL Installer loads thedashboardwhere installed MySQL products are listed and other MySQL Installer operations are available.

2.3.3.3.2 MySQL Router Configuration with MySQL Installer

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.

During theinitial setup, choose any predetermined setup type, except服务公司er only, to install the latest GA version of the tools. Use theCustomsetup type to install an individual tool or specific version. If MySQL Installer is installed on the host already, use theAddoperation to select and install tools from the MySQL Installer dashboard.

MySQL Router Configuration

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.

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.

To configure MySQL Router, do the following:

  1. Set up InnoDB Cluster.

  2. Using MySQL Installer, download and install the MySQL Router application. After the installation finishes, the configuration wizard prompts you for information. Select theConfigure MySQL Router for InnoDB Clustercheck box to begin the configuration and provide the following configuration values:

    • Hostname:Host name of the primary (seed) server in the InnoDB Cluster (localhostby default).

    • Port:The port number of the primary (seed) server in the InnoDB Cluster (3306by default).

    • Management User:An administrative user with root-level privileges.

    • Password:The password for the management user.

    • Classic MySQL protocol connections to InnoDB Cluster

      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.

      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.

    Figure 2.10 MySQL Router Configuration

    Content is described in the surrounding text.

  3. ClickNextand thenExecuteto apply the configuration. ClickFinishto close MySQL Installer or return to theMySQL Installer dashboard.

After configuring MySQL Router, the root account exists in the user table asroot@localhost(local) only, instead ofroot@%(remote). 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