2.3 Installing MySQL on Microsoft Windows

Important:

MySQL Community 5.7 Server requires the Microsoft Visual C++ 2019 Redistributable Package to run on Windows platforms. Users should make sure the package has been installed on the system before installing the server. The package is available at the Microsoft Download Center (http://www.microsoft.com/en-us/download/default.aspx).

This requirement changed over time: MySQL 5.7.37 and below requires the Microsoft Visual C++ 2013 Redistributable Package, MySQL 5.7.38 and 5.7.39 require both, and only the Microsoft Visual C++ 2019 Redistributable Package is required as of MySQL 5.7.40.

MySQL is available for Microsoft Windows, for both 32-bit and 64-bit versions. For supported Windows platform information, see https://www.mysql.com/support/supportedplatforms/database.html.

Important:

If your operating system is Windows 2008 R2 or Windows 7 and you do not have Service Pack 1 (SP1) installed, MySQL 5.7 regularly restarts with the following message in the MySQL server error log file:

 mysqld got exception 0xc000001d

This error message occurs because you are also using a CPU that does not support the VPSRLQ instruction, indicating that the CPU instruction that was attempted is not supported.

To fix this error, you must install SP1. This adds the required operating system support for CPU capability detection and disables that support when the CPU does not have the required instructions.

Alternatively, install an older version of MySQL, such as 5.6.

There are different methods to install MySQL on Microsoft Windows.

MySQL Installer Method

The simplest and recommended method is to download MySQL Installer (for Windows) and let it install and configure all of the MySQL products on your system. Here is how:

  1. Download MySQL Installer from https://dev.mysql.com/downloads/installer/ and execute it.

    Note:

    Unlike the standard MySQL Installer, the smaller "web-community" version does not bundle any MySQL applications but rather downloads the MySQL products you choose to install.

  2. Choose the appropriate 'Setup Type' for your system. Typically you should choose 'Developer Default' to install MySQL server and other MySQL tools related to MySQL development, helpful tools like MySQL Workbench. Choose the 'Custom' setup type instead to manually select your desired MySQL products.

    Note:

    Multiple versions of MySQL server can exist on a single system. You can choose one or multiple versions.

  3. Complete the installation process by following the instructions. This installa several MySQL products and starts the MySQL server.

MySQL is now installed. If you configured MySQL as a service, then Windows automatically starts MySQL server every time you restart your system.

Note:

You probably also installed other helpful MySQL products like MySQL Workbench on your system. Consider loading *note workbench:: to check your new MySQL server connection By default, this program automatically starts after installing MySQL.

This process also installs the MySQL Installer application on your system, and later you can use MySQL Installer to upgrade or reconfigure your MySQL products.

Additional Installation Information

It is possible to run MySQL as a standard application or as a Windows service. By using a service, you can monitor and control the operation of the server through the standard Windows service management tools. For more information, see *note windows-start-service::.

Generally, you should install MySQL on Windows using an account that has administrator rights. Otherwise, you may encounter problems with certain operations such as editing the 'PATH' environment variable or accessing the 'Service Control Manager'. When installed, MySQL does not need to be executed using a user with Administrator privileges.

For a list of limitations on the use of MySQL on the Windows platform, see *note windows-restrictions::.

In addition to the MySQL Server package, you may need or want additional components to use MySQL with your application or development environment. These include, but are not limited to:

MySQL distributions for Windows can be downloaded from https://dev.mysql.com/downloads/. See *note getting-mysql::.

MySQL for Windows is available in several distribution formats, detailed here. Generally speaking, you should use MySQL Installer. It contains more features and MySQL products than the older MSI, is simpler to use than the compressed file, and you need no additional tools to get MySQL up and running. MySQL Installer automatically installs MySQL Server and additional MySQL products, creates an options file, starts the server, and enables you to create default user accounts. For more information on choosing a package, see *note windows-choosing-package::.

MySQL on Windows Considerations

 File: manual.info.tmp, Node: windows-installation-layout, Next: windows-choosing-package, Prev: windows-installation, Up: windows-installation

2.3.1 MySQL Installation Layout on Microsoft Windows

For MySQL 5.7 on Windows, the default installation directory is 'C:FilesServer 5.7' for installations performed with MySQL Installer. If you use the ZIP archive method to install MySQL, you may prefer to install in 'C:'. However, the layout of the subdirectories remains the same.

All of the files are located within this parent directory, using the structure shown in the following table.

Default MySQL Installation Layout for Microsoft Windows

Directory Contents of Directory Notes

'bin'

*note 'mysqld': mysqld. server, client and utility programs

'%PROGRAMDATA%Server 5.7'

Log files, databases The Windows system variable %PROGRAMDATA% defaults to 'C:'.

'docs'

Release With MySQL Installer, use documentation the 'Modify' operation to select this optional folder.

'include'

Include (header) files

'lib'

Libraries

'share'

Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation

 File: manual.info.tmp, Node: windows-choosing-package, Next: mysql-installer, Prev: windows-installation-layout, Up: windows-installation

2.3.2 Choosing an Installation Package

For MySQL 5.7, there are multiple installation package formats to choose from when installing MySQL on Windows. The package formats described in this section are:

Program Database (PDB) files (with file name extension 'pdb') provide information for debugging your MySQL installation in the event of a problem. These files are included in ZIP Archive distributions (but not MSI distributions) of MySQL.

MySQL Installer

This package has a file name similar to 'mysql-installer-community-5.7.44.0.msi' or 'mysql-installer-commercial-5.7.44.0.msi', and uses MSIs to automatically install MySQL server and other products. MySQL Installer downloads and apply updates to itself, and for each of the installed products. It also configures the installed MySQL server (including a sandbox InnoDB cluster test setup) and MySQL Router. MySQL Installer is recommended for most users.

MySQL Installer can install and manage (add, modify, upgrade, and remove) many other MySQL products, including:

MySQL Installer operates on all MySQL supported versions of Windows (see https://www.mysql.com/support/supportedplatforms/database.html).

Note:

Because MySQL Installer is not a native component of Microsoft Windows and depends on .NET, it does not work on installations with minimal options like the Server Core version of Windows Server.

For instructions on how to install MySQL using MySQL Installer, see *note mysql-installer::.

MySQL noinstall ZIP Archives

These packages contain the files found in the complete MySQL Server installation package, with the exception of the GUI. This format does not include an automated installer, and must be manually installed and configured.

The 'noinstall' ZIP archives are split into two separate compressed files. The main package is named 'mysql-VERSION-winx64.zip' for 64-bit and 'mysql-VERSION-win32.zip' for 32-bit. This contains the components needed to use MySQL on your system. The optional MySQL test suite, MySQL benchmark suite, and debugging binaries/information components (including PDB files) are in a separate compressed file named 'mysql-VERSION-winx64-debug-test.zip' for 64-bit and 'mysql-VERSION-win32-debug-test.zip' for 32-bit.

If you choose to install a 'noinstall' ZIP archive, see *note windows-install-archive::.

MySQL Docker Images

For information on using the MySQL Docker images provided by Oracle on Windows platform, see *note deploy-mysql-nonlinux-docker::.

Warning:

The MySQL Docker images provided by Oracle are built specifically for Linux platforms. Other platforms are not supported, and users running the MySQL Docker images from Oracle on them are doing so at their own risk.

 File: manual.info.tmp, Node: mysql-installer, Next: windows-install-archive, Prev: windows-choosing-package, Up: windows-installation

2.3.3 MySQL Installer for Windows

MySQL Installer is a standalone application designed to ease the complexity of installing and configuring MySQL products that run on Microsoft Windows. It is downloaded with and supports the following MySQL products:

Installation Requirements

MySQL Installer requires Microsoft .NET Framework 4.5.2 or later. If this version is not installed on the host computer, you can download it by visiting the Microsoft website (https://www.microsoft.com/en-us/download/details.aspx?id=42643).

To invoke MySQL Installer after a successful installation:

  1. Right-click Windows Start, select 'Run', and then click 'Browse'. Navigate to 'Program Files (x86) > MySQL > MySQL Installer for Windows' to open the program folder.

  2. Select one of the following files:

    * 'MySQLInstaller.exe' to open the graphical application.
    
    * 'MySQLInstallerConsole.exe' to open the command-line
      application.
  3. Click 'Open' and then click 'OK' in the Run window. If you are prompted to allow the application to make changes to the device, select 'Yes'.

Each time you invoke MySQL Installer, the initialization process looks for the presence of an internet connection and prompts you to enable offline mode if it finds no internet access (and offline mode is disabled). Select 'Yes' to run MySQL Installer without internet-connection capabilities. MySQL product availability is limited to only those products currently in the product cache when you enable offline mode. To download MySQL products, click the offline mode 'Disable' quick action shown on the dashboard.

An internet connection is required to download a manifest containing metadata for the latest MySQL products that are not part of a full bundle. MySQL Installer attempts to download the manifest when you start the application for the first time and then periodically in configurable intervals (see MySQL Installer options). Alternatively, you can retrieve an updated manifest manually by clicking 'Catalog' in the MySQL Installer dashboard.

Note:

If the first-time or subsequent manifest download is unsuccessful, an error is logged and you may have limited access to MySQL products during your session. MySQL Installer attempts to download the manifest with each startup until the initial manifest structure is updated. For help finding a product, see *note locate-products::.

MySQL Installer Community Release

Download software from https://dev.mysql.com/downloads/installer/ to install the Community release of all MySQL products for Windows. Select one of the following MySQL Installer package options:

MySQL Installer Commercial Release

Download software from https://edelivery.oracle.com/ to install the Commercial release (Standard or Enterprise Edition) of MySQL products for Windows. If you are logged in to your My Oracle Support (MOS) account, the Commercial release includes all of the current and previous GA versions available in the Community release, but it excludes development-milestone versions. When you are not logged in, you see only the list of bundled products that you downloaded already.

The Commercial release also includes the following products:

The Commercial release integrates with your MOS account. For knowledge-base content and patches, see My Oracle Support (https://support.oracle.com/).

 File: manual.info.tmp, Node: mysql-installer-setup, Next: mysql-installer-change-path-proc, Prev: mysql-installer, Up: mysql-installer

2.3.3.1 MySQL Installer Initial Setup .....................................

When you download MySQL Installer for the first time, a setup wizard guides you through the initial installation of MySQL products. As the following figure shows, the initial setup is a one-time activity in the overall process. MySQL Installer detects existing MySQL products installed on the host during its initial setup and adds them to the list of products to be managed.

FIGURE GOES HERE: MySQL Installer Process Overview

MySQL Installer extracts configuration files (described later) to the hard drive of the host during the initial setup. Although MySQL Installer is a 32-bit application, it can install both 32-bit and 64-bit binaries.

The initial setup adds a link to the Start menu under the 'MySQL' folder group. Click 'Start', 'MySQL', and 'MySQL Installer - [Community | Commercial]' to open the community or commercial release of the graphical tool.

Choosing a Setup Type

During the initial setup, you are prompted to select the MySQL products to be installed on the host. One alternative is to use a predetermined setup type that matches your setup requirements. By default, both GA and pre-release products are included in the download and installation with the 'Client only' and 'Full' setup types. Select the 'Only install GA products' option to restrict the product set to include GA products only when using these setup types.

Note:

Commercial-only MySQL products, such as MySQL Enterprise Backup, are available to select and install if you are using the Commercial version of MySQL Installer (see *note mysql-installer-commercial-edition::).

Choosing one of the following setup types determines the initial installation only and does not limit your ability to install or update MySQL products for Windows later:

Path Conflicts

When the default installation or data folder (required by MySQL server) for a product to be installed already exists on the host, the wizard displays the 'Path Conflict' step to identify each conflict and enable you to take action to avoid having files in the existing folder overwritten by the new installation. You see this step in the initial setup only when MySQL Installer detects a conflict.

To resolve the path conflict, do one of the following:

Check Requirements

MySQL Installer uses entries in the 'package-rules.xml' file to determine whether the prerequisite software for each product is installed on the host. When the requirements check fails, MySQL Installer displays the 'Check Requirements' step to help you update the host. Requirements are evaluated each time you download a new product (or version) for installation. The following figure identifies and describes the key areas of this step.

FIGURE GOES HERE: Check Requirements

Description of Check Requirements Elements

  1. Shows the current step in the initial setup. Steps in this list may change slightly depending on the products already installed on the host, the availability of prerequisite software, and the products to be installed on the host.

  2. Lists all pending installation requirements by product and indicates the status as follows:

    * A blank space in the 'Status' column means that MySQL
      Installer can attempt to download and install the required
      software for you.
    
    * The word _Manual_ in the 'Status' column means that you must
      satisfy the requirement manually.  Select each product in the
      list to see its requirement details.
  3. Describes the requirement in detail to assist you with each manual resolution. When possible, a download URL is provided. After you download and install the required software, click 'Check' to verify that the requirement has been met.

  4. Provides the following set operations to proceed:

    * 'Back' - Return to the previous step.  This action enables you
      to select a different the setup type.
    
    * 'Execute' - Have MySQL Installer attempt to download and
      install the required software for all items without a manual
      status.  Manual requirements are resolved by you and verified
      by clicking 'Check'.
    
    * 'Next' - Do not execute the request to apply the requirements
      automatically and proceed to the installation without
      including the products that fail the check requirements step.
    
    * 'Cancel' - Stop the installation of MySQL products.  Because
      MySQL Installer is already installed, the initial setup begins
      again when you open MySQL Installer from the Start menu and
      click 'Add' from the dashboard.  For a description of the
      available management operations, see *note
      windows-product-catalog::.

MySQL Installer Configuration Files

All MySQL Installer files are located within the 'C:Files (x86)' and 'C:' folders. The following table describes the files and folders that define MySQL Installer as a standalone application.

Note:

Installed MySQL products are neither altered nor removed when you update or uninstall MySQL Installer.

MySQL Installer Configuration Files

File or Folder Description Folder Hierarchy

'MySQL Installer for Windows'

This folder contains 'C:Files (x86)' all of the files
needed to run MySQL Installer and *note 'MySQLInstallerConsole.exe': MySQLInstallerConsole, a command-line program with similar functionality.

'Templates'

The 'Templates' 'C:folder has one file Installer for for each version of Windows' MySQL server.
Template files contain keys and formulas to calculate some values dynamically.

'package-rules.xml'

This file contains 'C:the prerequisites Installer for for every product to Windows' be installed.

'products.xml'

The 'products' file 'C:(or product catalog) Installer for contains a list of Windows' all products
available for download.

'Product Cache'

The 'Product Cache' 'C:folder contains all Installer for Windows' standalone '.msi' files bundled with the full package or downloaded afterward.

 File: manual.info.tmp, Node: mysql-installer-change-path-proc, Next: mysql-installer-workflow, Prev: mysql-installer-setup, Up: mysql-installer

2.3.3.2 Setting Alternative Server Paths with MySQL Installer .............................................................

You can change the default installation path, the data path, or both when you install MySQL server. After you have installed the server, the paths cannot be altered without removing and reinstalling the server instance.

Note:

Starting with MySQL Installer 1.4.39, if you move the data directory of an installed server manually, MySQL Installer identifies the change and can process a reconfiguration operation without errors.

To change paths for MySQL server

Identify the MySQL server to change and enable the 'Advanced Options' link as follows:

Navigate to the 'Select Products' page by doing one of the following:

If this is an *note initial setup: mysql-installer-setup. of MySQL Installer, select the 'Custom' setup type and click 'Next'.

If MySQL Installer is installed on your computer, click 'Add' from the dashboard.

Click 'Edit' to apply a filter on the product list shown in 'Available Products' (see *note locate-products::).

With the server instance selected, use the arrow to move the selected server to the 'Products To Be Installed' list.

Click the server to select it. When you select the server, the 'Advanced Options' link is enabled below the list of products to be installed (see the following figure).

Click 'Advanced Options' to open a dialog box where you can enter alternative path names. After the path names are validated, click 'Next' to continue with the configuration steps.

FIGURE GOES HERE: Change MySQL Server Path

 File: manual.info.tmp, Node: mysql-installer-workflow, Next: mysql-installer-catalog-dashboard, Prev: mysql-installer-change-path-proc, Up: mysql-installer

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, see *note locate-products::.

Note:

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

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:

 File: manual.info.tmp, Node: mysql-installer-workflow-server, Next: mysql-installer-workflow-nonserver-products, Prev: mysql-installer-workflow, Up: mysql-installer-workflow

2.3.3.4 MySQL Server Configuration with MySQL Installer .......................................................

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

During the configuration process, click 'Next' to proceed to the next step or 'Back' to return to the previous step. Click 'Execute' at 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.

 File: manual.info.tmp, Node: server-type-network, Next: server-authentication-method, Prev: mysql-installer-workflow-server, Up: mysql-installer-workflow-server

2.3.3.5 Type and Networking ...........................

 File: manual.info.tmp, Node: server-authentication-method, Next: server-accounts-roles, Prev: server-type-network, Up: mysql-installer-workflow-server

2.3.3.6 Authentication Method .............................

The 'Authentication Method' step 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 use 'libmysqlclient' 8.0 now support the 'caching_sha2_password' default 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 use 'mysql_native_password' for legacy authentication. For more information about the implications of this change, see caching_sha2_password as the Preferred Authentication Plugin (https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password).

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

 File: manual.info.tmp, Node: server-accounts-roles, Next: server-windows-service, Prev: server-authentication-method, Up: mysql-installer-workflow-server

2.3.3.7 Accounts and Roles ..........................

 File: manual.info.tmp, Node: server-windows-service, Next: server-file-permission-options, Prev: server-accounts-roles, Up: mysql-installer-workflow-server

2.3.3.8 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.

 File: manual.info.tmp, Node: server-file-permission-options, Next: server-logging-options, Prev: server-windows-service, Up: mysql-installer-workflow-server

2.3.3.9 Server File Permissions ...............................

Optionally, permissions set on the folders and files located at 'C:Server 8.0' can be managed during the server configuration operation. You have the following options:

 File: manual.info.tmp, Node: server-logging-options, Next: server-advanced-options, Prev: server-file-permission-options, Up: mysql-installer-workflow-server

2.3.3.10 Logging Options ........................

This step is available if the 'Show Advanced Configuration' check box was selected during the 'Type and Networking' step. To enable this step now, click 'Back' to return to the 'Type and Networking' step and select the check box.

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

Note:

The binary log is enabled by default.

 File: manual.info.tmp, Node: server-advanced-options, Next: server-apply-config, Prev: server-logging-options, Up: mysql-installer-workflow-server

2.3.3.11 Advanced Options .........................

This step is available if the 'Show Advanced Configuration' check box was selected during the 'Type and Networking' step. To enable this step now, click 'Back' to return to the 'Type and Networking' step and select the check box.

The advanced-configuration options include:

 File: manual.info.tmp, Node: server-apply-config, Prev: server-advanced-options, Up: mysql-installer-workflow-server

2.3.3.12 Apply Server Configuration ...................................

All configuration settings are applied to the MySQL server when you click 'Execute'. Use the 'Configuration Steps' tab 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 the 'Log' tab to view the log.

When the installation completes successfully and you click 'Finish', MySQL Installer and the installed MySQL products are added to the Microsoft Windows Start menu under the 'MySQL' group. Opening MySQL Installer loads the dashboard where installed MySQL products are listed and other MySQL Installer operations are available.

 File: manual.info.tmp, Node: mysql-installer-workflow-nonserver-products, Prev: mysql-installer-workflow-server, Up: mysql-installer-workflow

2.3.3.13 MySQL Router Configuration with MySQL Installer ........................................................

During the *note initial setup: mysql-installer-setup, choose any predetermined setup type, except 'Server only', to install the latest GA version of the tools. Use the 'Custom' setup type to install an individual tool or specific version. If MySQL Installer is installed on the host already, use the 'Add' operation 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 the 'Configure MySQL Router for InnoDB Cluster' check box to begin the configuration and provide the following configuration values:

    * 'Hostname:' Host name of the primary (seed) server in the
      InnoDB Cluster ('localhost' by default).
    
    * 'Port:' The port number of the primary (seed) server in the
      InnoDB Cluster ('3306' by 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 GOES HERE: MySQL Router Configuration

  3. Click 'Next' and then 'Execute' to apply the configuration. Click 'Finish' to close MySQL Installer or return to the MySQL Installer dashboard.

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

 $> \c root@localhost:6446

 File: manual.info.tmp, Node: mysql-installer-catalog-dashboard, Next: MySQLInstallerConsole, Prev: mysql-installer-workflow, Up: mysql-installer

2.3.3.14 MySQL Installer Product Catalog and Dashboard ......................................................

This section describes the MySQL Installer product catalog, the dashboard, and other actions related to product selection and upgrades.

Product Catalog

The product catalog stores the complete list of released MySQL products for Microsoft Windows that are available to download from MySQL Downloads (https://dev.mysql.com/downloads/). By default, and when an Internet connection is present, MySQL Installer attempts to update the catalog at startup every seven days. You can also update the catalog manually from the dashboard (described later).

An up-to-date catalog performs the following actions:

The catalog includes all development releases (Pre-Release), general releases (Current GA), and minor releases (Other Releases). Products in the catalog will vary somewhat, depending on the MySQL Installer release that you download.

MySQL Installer Dashboard

The MySQL Installer dashboard is the default view that you see when you start MySQL Installer after the *note initial setup: mysql-installer-setup. finishes. If you closed MySQL Installer before the setup was finished, MySQL Installer resumes the initial setup before it displays the dashboard.

Note:

Products covered under Oracle Lifetime Sustaining Support, if installed, may appear in the dashboard. These products, such as MySQL for Excel and MySQL Notifier, can be modified or removed only.

FIGURE GOES HERE: MySQL Installer Dashboard Elements

Description of MySQL Installer Dashboard Elements

  1. MySQL Installer dashboard operations provide a variety of actions that apply to installed products or products listed in the catalog. To initiate the following operations, first click the operation link and then select the product or products to manage:

    * 'Add': This operation opens the Select Products page.  From
      there you can adjust the filter, select one or more products
      to download (as needed), and begin the installation.  For
      hints about using the filter, see *note locate-products::.
    
      Use the directional arrows to move each product from the
      'Available Products' column to the 'Products To Be Installed'
      column.  To enable the Product Features page where you can
      customize features, click the related check box (disabled by
      default).
    
    * 'Modify': Use this operation to add or remove the features
      associated with installed products.  Features that you can
      modify vary in complexity by product.  When the 'Program
      Shortcut' check box is selected, the product appears in the
      Start menu under the 'MySQL' group.
    
    * 'Upgrade': This operation loads the Select Products to Upgrade
      page and populates it with all the upgrade candidates.  An
      installed product can have more than one upgrade version and
      the operation requires a current product catalog.  MySQL
      Installer upgrades all of the selected products in one action.
      Click 'Show Details' to view the actions performed by MySQL
      Installer.
    
    * 'Remove': This operation opens the Remove Products page and
      populates it with the MySQL products installed on the host.
      Select the MySQL products you want to remove (uninstall) and
      then click 'Execute' to begin the removal process.  During the
      operation, an indicator shows the number of steps that are
      executed as a percentage of all steps.
    
      To select products to remove, do one of the following:
    
         * Select the check box for one or more products.
    
         * Select the 'Product' check box to select all products.
  2. The 'Reconfigure' link in the Quick Action column next to each installed server loads the current configuration values for the server and then cycles through all configuration steps enabling you to change the options and values. You must provide credentials with root privileges to reconfigure these items. Click the 'Log' tab to show the output of each configuration step performed by MySQL Installer.

    On completion, MySQL Installer stops the server, applies the configuration changes, and restarts the server for you. For a description of each configuration option, see *note mysql-installer-workflow-server::. Installed 'Samples and Examples' associated with a specific MySQL server version can be also be reconfigured to apply new feature settings, if any.

  3. The 'Catalog' link enables you to download the latest catalog of MySQL products manually and then to integrate those product changes with MySQL Installer. The catalog-download action does not perform an upgrade of the products already installed on the host. Instead, it returns to the dashboard and adds an arrow icon to the Version column for each installed product that has a newer version. Use the 'Upgrade' operation to install the newer product version.

    You can also use the 'Catalog' link to display the current change history of each product without downloading the new catalog. Select the 'Do not update at this time' check box to view the change history only.

  4. The MySQL Installer About icon (

    About icon

    ) shows the current version of MySQL Installer and general information about MySQL. The version number is located above the 'Back' button.

    Tip:

    Always include this version number when reporting a problem with MySQL Installer.

    In addition to the About MySQL information (

    About MySQL icon

    ), you can also select the following icons from the side panel:

    * License icon (
    
      License icon
    
      ) for MySQL Installer.
    
      This product may include third-party software, used under
      license.  If you are using a Commercial release of MySQL
      Installer, the icon opens the MySQL Installer Commercial
      License Information User Manual for licensing information,
      including licensing information relating to third-party
      software that may be included in this Commercial release.  If
      you are using a Community release of MySQL Installer, the icon
      opens the MySQL Installer Community License Information User
      Manual for licensing information, including licensing
      information relating to third-party software that may be
      included in this Community release.
    
    * Resource links icon (
    
      Resource links icon
    
      ) to the latest MySQL product documentation, blogs, webinars,
      and more.
  5. The MySQL Installer Options icon (

    ) includes the following tabs:

    * 'General': Enables or disables the Offline mode option.  If
      selected, this option configures MySQL Installer to run
      without depending on internet-connection capabilities.  When
      running MySQL Installer in offline mode, you see a warning
      together with a 'Disable' quick action on the dashboard.  The
      warning serves to remind you that running MySQL Installer in
      offline mode prevents you from downloading the latest MySQL
      products and product catalog updates.  Offline mode persists
      until you disable the option.
    
      At startup, MySQL Installer determines whether an internet
      connection is present, and, if not, prompts you to enable
      offline mode to resume working without a connection.
    
    * 'Product Catalog': Manages the automatic catalog updates.  By
      default, MySQL Installer checks for catalog updates at startup
      every seven days.  When new products or product versions are
      available, MySQL Installer adds them to the catalog and then
      inserts an arrow icon (
    
      ) next to the version number of installed products listed in
      the dashboard.
    
      Use the product catalog option to enable or disable automatic
      updates and to reset the number of days between automatic
      catalog downloads.  At startup, MySQL Installer uses the
      number of days you set to determine whether a download should
      be attempted.  This action is repeated during next startup if
      MySQL Installer encounters an error downloading the catalog.
    
    * 'Connectivity Settings': Several operations performed by MySQL
      Installer require internet access.  This option enables you to
      use a default value to validate the connection or to use a
      different URL, one selected from a list or added by you
      manually.  With the 'Manual' option selected, new URLs can be
      added and all URLs in the list can be moved or deleted.  When
      the 'Automatic' option is selected, MySQL Installer attempts
      to connect to each default URL in the list (in order) until a
      connection is made.  If no connection can be made, it raises
      an error.
    
    * 'Proxy': MySQL Installer provides multiple proxy modes that
      enable you to download MySQL products, updates, or even the
      product catalog in most network environments.  The mode are:
    
         * 'No proxy'
    
           Select this mode to prevent MySQL Installer from looking
           for system settings.  This mode disables any proxy
           settings.
    
         * 'Automatic'
    
           Select this mode to have MySQL Installer look for system
           settings and to use those settings if found, or to use no
           proxy if nothing is found.  This mode is the default.
    
         * 'Manual'
    
           Select this mode to have MySQL Installer use your
           authentication details to configuration proxy access to
           the internet.  Specifically:
    
              * A proxy-server address ('http://'ADDRESS-TO-SERVER)
                and port number
    
              * A user name and password for authentication

Locating Products to Install

MySQL products in the catalog are listed by category: MySQL Servers, Applications, MySQL Connectors, and Documentation. Only the latest GA versions appear in the 'Available Products' pane by default. If you are looking for a pre-release or older version of a product, it may not be visible in the default list.

Note:

Keep the product catalog up-to-date. Click 'Catalog' on the MySQL Installer dashboard to download the latest manifest.

To change the default product list, click 'Add' in the dashboard to open the Select Products page, and then click 'Edit' to open the dialog box shown in the figure that follows. Modify the settings and then click 'Filter'.

FIGURE GOES HERE: Filter Available Products

Reset one or more of the following fields to modify the list of available products:

Upgrading MySQL Server

Important server upgrade conditions:

To choose a new server version:

  1. Click 'Upgrade'. Confirm that the check box next to product name in the 'Upgradeable Products' pane has a check mark. Deselect the products that you do not intend to upgrade at this time.

    Note:

    For server milestone releases in the same release series, MySQL Installer deselects the server upgrade and displays a warning to indicate that the upgrade is not supported, identifies the risks of continuing, and provides a summary of the steps to perform a logical upgrade manually. You can reselect server upgrade at your own risk. For instructions on how to perform a logical upgrade with a milestone release, see *note upgrade-procedure-logical::.

  2. Click a product in the list to highlight it. This action populates the 'Upgradeable Versions' pane with the details of each available version for the selected product: version number, published date, and a 'Changes' link to open the release notes for that version.

Removing MySQL Server

To remove a local MySQL server:

  1. Determine whether the local data directory should be removed. If you retain the data directory, another server installation can reuse the data. This option is enabled by default (removes the data directory).

  2. Click 'Execute' to begin uninstalling the local server. Note that all products that you selected to remove are also uninstalled at this time.

  3. (Optional) Click the 'Log' tab to display the current actions performed by MySQL Installer.

Upgrading MySQL Installer

MySQL Installer remains installed on your computer, and like other software, MySQL Installer can be upgraded from the previous version. In some cases, other MySQL software may require that you upgrade MySQL Installer for compatibility. This section describes how to identify the current version of MySQL Installer and how to upgrade MySQL Installer manually.

To locate the installed version of MySQL Installer:

  1. Start MySQL Installer from the search menu. The MySQL Installer dashboard opens.

  2. Click the MySQL Installer About icon (

    About icon

    ). The version number is located above the 'Back' button.

To initiate an on-demand upgrade of MySQL Installer:

  1. Connect the computer with MySQL Installer installed to the internet.

  2. Start MySQL Installer from the search menu. The MySQL Installer dashboard opens.

  3. Click 'Catalog' on the bottom of the dashboard to open the Update Catalog window.

  4. Click 'Execute' to begin the process. If the installed version of MySQL Installer can be upgraded, you will be prompted to start the upgrade.

  5. Click 'Next' to review all changes to the catalog and then click 'Finish' to return to the dashboard.

  6. Verify the (new) installed version of MySQL Installer (see the previous procedure).

 File: manual.info.tmp, Node: MySQLInstallerConsole, Prev: mysql-installer-catalog-dashboard, Up: mysql-installer

2.3.3.15 MySQL Installer Console Reference ..........................................

*note 'MySQLInstallerConsole.exe': MySQLInstallerConsole. provides command-line functionality that is similar to MySQL Installer. This reference includes:

The console is installed when MySQL Installer is initially executed and then available within the 'MySQL Installer for Windows' directory. By default, the directory location is 'C:Files (x86)Installer for Windows'. You must run the console as administrator.

To use the console:

  1. Open a command prompt with administrative privileges by selecting 'Windows System' from 'Start', then right-click 'Command Prompt', select 'More', and select 'Run as administrator'.

  2. From the command line, optionally change the directory to where the *note 'MySQLInstallerConsole.exe': MySQLInstallerConsole. command is located. For example, to use the default installation location:

      cd Program Files (x86)\MySQL\MySQL Installer for Windows
  3. Type 'MySQLInstallerConsole.exe' (or 'mysqlinstallerconsole') followed by a command action to perform a task. For example, to show the console's help:

      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 packages in the bundle.
      Categorizing product catalog.
      Finding all installed packages.
      Your product catalog was last updated at 23/08/2022 12:41:05 p. m.
      Your product catalog has version number 671.
      =================== End Initialization ===================
    
      The following actions are available:
    
      Configure - Configures one or more of your installed programs.
      Help      - Provides list of available command actions.
      Install   - Installs and configures one or more available MySQL programs.
      List      - Lists all available MySQL products.
      Modify    - Modifies the features of installed products.
      Remove    - Removes one or more products from your system.
      Set       - Configures the general options of MySQL Installer.
      Status    - Shows the status of all installed products.
      Update    - Updates the current product catalog.
      Upgrade   - Upgrades one or more of your installed programs.
    
      The basic syntax for using MySQL Installer command actions. Brackets denote optional entities.
      Curly braces denote a list of possible entities.
    
      ...

MySQL Product Names

Many of the *note 'MySQLInstallerConsole': MySQLInstallerConsole. command actions accept one or more abbreviated phrases that can match a MySQL product (or products) in the catalog. The current set of valid short phrases for use with commands is shown in the following table.

Note:

Starting with MySQL Installer 1.6.7 (8.0.34), the 'install', 'list', and 'upgrade' command options no longer apply to MySQL for Visual Studio (now EOL), MySQL Connector/NET, MySQL Connector/ODBC, MySQL Connector/C++, MySQL Connector/Python, and MySQL Connector/J. To install newer MySQL connectors, visit https://dev.mysql.com/downloads/.

MySQL Product Phrases for use with the MySQLInstallerConsole.exe command

Phrase MySQL Product

'server' MySQL Server

'workbench' MySQL Workbench

'shell' MySQL Shell

'visual' MySQL for Visual Studio

'router' MySQL Router

'backup' MySQL Enterprise Backup (requires the commercial release)

'net' MySQL Connector/NET

'odbc' MySQL Connector/ODBC

'c++' MySQL Connector/C++

'python' MySQL Connector/Python

'j' MySQL Connector/J

'documentation' MySQL Server Documentation

'samples' MySQL Samples (sakila and world databases)

Command Syntax

The *note 'MySQLInstallerConsole.exe': MySQLInstallerConsole. command can be issued with or without the file extension ('.exe') and the command is not case-sensitive.

'mysqlinstallerconsole'['.exe'] [[['--']ACTION] [ACTION_BLOCKS_LIST] [OPTIONS_LIST]]

Description:

  1. 'ACTION'

    One of the permitted operational actions. If omitted, the default action is equivalent to the '--status' action. Using the '--' prefix is optional for all actions.

    Possible actions are: [-]'configure', [-]'help', [-]'install', [-]'list', [-]'modify', [-]'remove', [-]'set', [-]'status', [-]'update', and [-]'upgrade'.

  2. 'ACTION_BLOCKS_LIST'

    A list of blocks in which each represents a different item depending on the selected action. Blocks are separated by commas.

    The '--remove' and '--upgrade' actions permit specifying an asterisk character ('') to indicate all products. If the '' character is detected at the start of this block, it is assumed all products are to be processed and the remainder of the block is ignored.

    Syntax: '*|ACTION_BLOCK[,ACTION_BLOCK][,ACTION_BLOCK]...'

    ACTION_BLOCK: Contains a product selector followed by an indefinite number of argument blocks that behave differently depending on the selected action (see *note mi-console-actions::).

  3. 'OPTIONS_LIST'

    Zero or more options with possible values separated by spaces. See *note mi-console-actions:: to identify the options permitted for the corresponding action.

    Syntax: 'OPTION_VALUE_PAIR[ OPTION_VALUE_PAIR][ OPTION_VALUE_PAIR]...'

    OPTION_VALUE_PAIR: A single option (for example, '--silent') or a tuple of a key and a corresponding value with an options prefix. The key-value pair is in the form of '--KEY[=VALUE]'.

Command Actions

*note 'MySQLInstallerConsole.exe': MySQLInstallerConsole. supports the following command actions:

Note:

Configuration block (or arguments_block) values that contain a colon character (':') must be wrapped in quotation marks. For example, 'install_dir="C:Server 8.0"'.

 File: manual.info.tmp, Node: windows-install-archive, Next: windows-troubleshooting, Prev: mysql-installer, Up: windows-installation

2.3.4 Installing MySQL on Microsoft Windows Using a 'noinstall' ZIP Archive

Users who are installing from the 'noinstall' package can use the instructions in this section to manually install MySQL. The process for installing MySQL from a ZIP Archive package is as follows:

  1. Extract the main archive to the desired install directory

    Optional: also extract the debug-test archive if you plan to execute the MySQL benchmark and test suite

  2. Create an option file

  3. Choose a MySQL server type

  4. Initialize MySQL

  5. Start the MySQL server

  6. Secure the default user accounts

This process is described in the sections that follow.

 File: manual.info.tmp, Node: windows-extract-archive, Next: windows-create-option-file, Prev: windows-install-archive, Up: windows-install-archive

2.3.4.1 Extracting the Install Archive ......................................

To install MySQL manually, do the following:

  1. If you are upgrading from a previous version please refer to *note windows-upgrading::, before beginning the upgrade process.

  2. Make sure that you are logged in as a user with administrator privileges.

  3. Choose an installation location. Traditionally, the MySQL server is installed in 'C:'. If you do not install MySQL at 'C:', you must specify the path to the install directory during startup or in an option file. See *note windows-create-option-file::.

    Note:

    The MySQL Installer installs MySQL under 'C:Files'.

  4. Extract the install archive to the chosen installation location using your preferred file-compression tool. Some tools may extract the archive to a folder within your chosen installation location. If this occurs, you can move the contents of the subfolder into the chosen installation location.

 File: manual.info.tmp, Node: windows-create-option-file, Next: windows-select-server, Prev: windows-extract-archive, Up: windows-install-archive

2.3.4.2 Creating an Option File ...............................

If you need to specify startup options when you run the server, you can indicate them on the command line or place them in an option file. For options that are used every time the server starts, you may find it most convenient to use an option file to specify your MySQL configuration. This is particularly true under the following circumstances:

When the MySQL server starts on Windows, it looks for option files in several locations, such as the Windows directory, 'C:', and the MySQL installation directory (for the full list of locations, see *note option-files::). The Windows directory typically is named something like 'C:'. You can determine its exact location from the value of the 'WINDIR' environment variable using the following command:

 C:\> echo %WINDIR%

MySQL looks for options in each location first in the 'my.ini' file, and then in the 'my.cnf' file. However, to avoid confusion, it is best if you use only one file. If your PC uses a boot loader where 'C:' is not the boot drive, your only option is to use the 'my.ini' file. Whichever option file you use, it must be a plain text file.

Note:

When using the MySQL Installer to install MySQL Server, it creates the 'my.ini' in the default location, and the user executing MySQL Installer is granted full permissions to this new 'my.ini' file.

In other words, be sure that the MySQL Server user has permission to read the 'my.ini' file.

You can also make use of the example option files included with your MySQL distribution; see *note server-configuration-defaults::.

An option file can be created and modified with any text editor, such as Notepad. For example, if MySQL is installed in 'E:' and the data directory is in 'E:', you can create an option file containing a '[mysqld]' section to specify values for the 'basedir' and 'datadir' options:

 [mysqld]
 # set basedir to your installation path
 basedir=E:/mysql
 # set datadir to the location of your data directory
 datadir=E:/mydata/data

Microsoft Windows path names are specified in option files using (forward) slashes rather than backslashes. If you do use backslashes, double them:

 [mysqld]
 # set basedir to your installation path
 basedir=E:\\mysql
 # set datadir to the location of your data directory
 datadir=E:\\mydata\\data

The rules for use of backslash in option file values are given in *note option-files::.

As of MySQL 5.7.6, the ZIP archive no longer includes a 'data' directory. To initialize a MySQL installation by creating the data directory and populating the tables in the mysql system database, initialize MySQL using either '--initialize' or '--initialize-insecure'. For additional information, see *note data-directory-initialization::.

If you would like to use a data directory in a different location, you should copy the entire contents of the 'data' directory to the new location. For example, if you want to use 'E:' as the data directory instead, you must do two things:

  1. Move the entire 'data' directory and all of its contents from the default location (for example 'C:FilesServer 5.7') to 'E:'.

  2. Use a '--datadir' option to specify the new data directory location each time you start the server.

 File: manual.info.tmp, Node: windows-select-server, Next: windows-initialize-data-directory, Prev: windows-create-option-file, Up: windows-install-archive

2.3.4.3 Selecting a MySQL Server Type .....................................

The following table shows the available servers for Windows in MySQL 5.7.

Binary Description

*note 'mysqld': mysqld.Optimized binary with named-pipe support

note 'mysqld-debug': mysqld.Like note 'mysqld': mysqld, but compiled with full debugging and automatic memory allocation checking

All of the preceding binaries are optimized for modern Intel processors, but should work on any Intel i386-class or higher processor.

Each of the servers in a distribution support the same set of storage engines. The *note 'SHOW ENGINES': show-engines. statement displays which engines a given server supports.

All Windows MySQL 5.7 servers have support for symbolic linking of database directories.

MySQL supports TCP/IP on all Windows platforms. MySQL servers on Windows also support named pipes, if you start the server with the 'named_pipe' system variable enabled. It is necessary to enable this variable explicitly because some users have experienced problems with shutting down the MySQL server when named pipes were used. The default is to use TCP/IP regardless of platform because named pipes are slower than TCP/IP in many Windows configurations.

 File: manual.info.tmp, Node: windows-initialize-data-directory, Next: windows-server-first-start, Prev: windows-select-server, Up: windows-install-archive

2.3.4.4 Initializing the Data Directory .......................................

If you installed MySQL using the 'noinstall' package, you may need to initialize the data directory:

 File: manual.info.tmp, Node: windows-server-first-start, Next: windows-start-command-line, Prev: windows-initialize-data-directory, Up: windows-install-archive

2.3.4.5 Starting the Server for the First Time ..............................................

This section gives a general overview of starting the MySQL server. The following sections provide more specific information for starting the MySQL server from the command line or as a Windows service.

The information here applies primarily if you installed MySQL using the 'noinstall' version, or if you wish to configure and test MySQL manually rather than with the GUI tools.

The examples in these sections assume that MySQL is installed under the default location of 'C:FilesServer 5.7'. Adjust the path names shown in the examples if you have MySQL installed in a different location.

Clients have two options. They can use TCP/IP, or they can use a named pipe if the server supports named-pipe connections.

MySQL for Windows also supports shared-memory connections if the server is started with the 'shared_memory' system variable enabled. Clients can connect through shared memory by using the '--protocol=MEMORY' option.

For information about which server binary to run, see *note windows-select-server::.

Testing is best done from a command prompt in a console window (or 'DOS window'). In this way you can have the server display status messages in the window where they are easy to see. If something is wrong with your configuration, these messages make it easier for you to identify and fix any problems.

Note:

The database must be initialized before MySQL can be started. For additional information about the initialization process, see *note data-directory-initialization::.

To start the server, enter this command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --console

For a server that includes 'InnoDB' support, you should see the messages similar to those following as it starts (the path names and sizes may differ):

 InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist:
 InnoDB: a new database to be created!
 InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200
 InnoDB: Database physically writes the file full: wait...
 InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be created
 InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280
 InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be created
 InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280
 InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be created
 InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280
 InnoDB: Doublewrite buffer not found: creating new
 InnoDB: Doublewrite buffer created
 InnoDB: creating foreign key constraint system tables
 InnoDB: foreign key constraint system tables created
 011024 10:58:25  InnoDB: Started

When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections:

 mysqld: ready for connections
 Version: '5.7.44'  socket: ''  port: 3306

The server continues to write to the console any further diagnostic output it produces. You can open a new console window in which to run client programs.

If you omit the '--console' option, the server writes diagnostic output to the error log in the data directory ('C:FilesServer 5.7' by default). The error log is the file with the '.err' extension, and may be set using the '--log-error' option.

Note:

The initial 'root' account in the MySQL grant tables has no password. After starting the server, you should set up a password for it using the instructions in *note default-privileges::.

 File: manual.info.tmp, Node: windows-start-command-line, Next: mysql-installation-windows-path, Prev: windows-server-first-start, Up: windows-install-archive

2.3.4.6 Starting MySQL from the Windows Command Line ....................................................

The MySQL server can be started manually from the command line. This can be done on any version of Windows.

To start the *note 'mysqld': mysqld. server from the command line, you should start a console window (or 'DOS window') and enter this command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld"

The path to *note 'mysqld': mysqld. may vary depending on the install location of MySQL on your system.

You can stop the MySQL server by executing this command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" -u root shutdown

Note:

If the MySQL 'root' user account has a password, you need to invoke *note 'mysqladmin': mysqladmin. with the '-p' option and supply the password when prompted.

This command invokes the MySQL administrative utility *note 'mysqladmin': mysqladmin. to connect to the server and tell it to shut down. The command connects as the MySQL 'root' user, which is the default administrative account in the MySQL grant system.

Note:

Users in the MySQL grant system are wholly independent from any operating system users under Microsoft Windows.

If *note 'mysqld': mysqld. does not start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. By default, the error log is located in the 'C:FilesServer 5.7' directory. It is the file with a suffix of '.err', or may be specified by passing in the '--log-error' option. Alternatively, you can try to start the server with the '--console' option; in this case, the server may display some useful information on the screen to help solve the problem.

The last option is to start note 'mysqld': mysqld. with the '--standalone' and '--debug' options. In this case, note 'mysqld': mysqld. writes a log file 'C:.trace' that should contain the reason why note 'mysqld': mysqld. doesn't start. See note dbug-package::.

Use note 'mysqld --verbose --help': mysqld. to display all the options that note 'mysqld': mysqld. supports.

 File: manual.info.tmp, Node: mysql-installation-windows-path, Next: windows-start-service, Prev: windows-start-command-line, Up: windows-install-archive

2.3.4.7 Customizing the PATH for MySQL Tools ............................................

Warning:

You must exercise great care when editing your system 'PATH' by hand; accidental deletion or modification of any portion of the existing 'PATH' value can leave you with a malfunctioning or even unusable system.

To make it easier to invoke MySQL programs, you can add the path name of the MySQL 'bin' directory to your Windows system 'PATH' environment variable:

You should not add the MySQL 'bin' directory to your Windows 'PATH' if you are running multiple MySQL servers on the same machine.

 File: manual.info.tmp, Node: windows-start-service, Next: windows-testing, Prev: mysql-installation-windows-path, Up: windows-install-archive

2.3.4.8 Starting MySQL as a Windows Service ...........................................

On Windows, the recommended way to run MySQL is to install it as a Windows service, so that MySQL starts and stops automatically when Windows starts and stops. A MySQL server installed as a service can also be controlled from the command line using 'NET' commands, or with the graphical 'Services' utility. Generally, to install MySQL as a Windows service you should be logged in using an account that has administrator rights.

The 'Services' utility (the Windows 'Service Control Manager') can be found in the Windows Control Panel. To avoid conflicts, it is advisable to close the 'Services' utility while performing server installation or removal operations from the command line.

Installing the service

Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin"
           -u root shutdown

Note:

If the MySQL 'root' user account has a password, you need to invoke *note 'mysqladmin': mysqladmin. with the '-p' option and supply the password when prompted.

This command invokes the MySQL administrative utility *note 'mysqladmin': mysqladmin. to connect to the server and tell it to shut down. The command connects as the MySQL 'root' user, which is the default administrative account in the MySQL grant system.

Note:

Users in the MySQL grant system are wholly independent from any operating system users under Windows.

Install the server as a service using this command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --install

The service-installation command does not start the server. Instructions for that are given later in this section.

To make it easier to invoke MySQL programs, you can add the path name of the MySQL 'bin' directory to your Windows system 'PATH' environment variable:

Warning:

You must exercise great care when editing your system 'PATH' by hand; accidental deletion or modification of any portion of the existing 'PATH' value can leave you with a malfunctioning or even unusable system.

The following additional arguments can be used when installing the service:

For a MySQL server that is installed as a Windows service, the following rules determine the service name and option files that the server uses:

As a more complex example, consider the following command:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld"
           --install MySQL --defaults-file=C:\my-opts.cnf

Here, the default service name ('MySQL') is given after the '--install' option. If no '--defaults-file' option had been given, this command would have the effect of causing the server to read the '[mysqld]' group from the standard option files. However, because the '--defaults-file' option is present, the server reads options from the '[mysqld]' option group, and only from the named file.

Note:

On Windows, if the server is started with the '--defaults-file' and '--install' options, '--install' must be first. Otherwise, 'mysqld.exe' attempts to start the MySQL server.

You can also specify options as Start parameters in the Windows 'Services' utility before you start the MySQL service.

Finally, before trying to start the MySQL service, make sure the user variables '%TEMP%' and '%TMP%' (and also '%TMPDIR%', if it has ever been set) for the operating system user who is to run the service are pointing to a folder to which the user has write access. The default user for running the MySQL service is 'LocalSystem', and the default value for its '%TEMP%' and '%TMP%' is 'C:', a directory 'LocalSystem' has write access to by default. However, if there are any changes to that default setup (for example, changes to the user who runs the service or to the mentioned user variables, or the '--tmpdir' option has been used to put the temporary directory somewhere else), the MySQL service might fail to run because write access to the temporary directory has not been granted to the proper user.

Starting the service

After a MySQL server instance has been installed as a service, Windows starts the service automatically whenever Windows starts. The service also can be started immediately from the 'Services' utility, or by using an 'sc start MYSQLD_SERVICE_NAME' or 'NET START MYSQLD_SERVICE_NAME' command. 'SC' and 'NET' commands are not case-sensitive.

When run as a service, note 'mysqld': mysqld. has no access to a console window, so no messages can be seen there. If note 'mysqld': mysqld. does not start, check the error log to see whether the server wrote any messages there to indicate the cause of the problem. The error log is located in the MySQL data directory (for example, 'C:FilesServer 5.7'). It is the file with a suffix of '.err'.

When a MySQL server has been installed as a service, and the service is running, Windows stops the service automatically when Windows shuts down. The server also can be stopped manually using the 'Services' utility, the 'sc stop MYSQLD_SERVICE_NAME' command, the 'NET STOP MYSQLD_SERVICE_NAME' command, or the *note 'mysqladmin shutdown': mysqladmin. command.

You also have the choice of installing the server as a manual service if you do not wish for the service to be started automatically during the boot process. To do this, use the '--install-manual' option rather than the '--install' option:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --install-manual

Removing the service

To remove a server that is installed as a service, first stop it if it is running by executing 'SC STOP MYSQLD_SERVICE_NAME' or 'NET STOP MYSQLD_SERVICE_NAME'. Then use 'SC DELETE MYSQLD_SERVICE_NAME' to remove it:

 C:\> SC DELETE mysql

Alternatively, use the *note 'mysqld': mysqld. '--remove' option to remove the service.

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --remove

If note 'mysqld': mysqld. is not running as a service, you can start it from the command line. For instructions, see note windows-start-command-line::.

If you encounter difficulties during installation, see *note windows-troubleshooting::.

For more information about stopping or removing a Windows service, see *note multiple-windows-services::.

 File: manual.info.tmp, Node: windows-testing, Prev: windows-start-service, Up: windows-install-archive

2.3.4.9 Testing The MySQL Installation ......................................

You can test whether the MySQL server is working by executing any of the following commands:

 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlshow"
 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlshow" -u root mysql
 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" version status proc
 C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" test

If note 'mysqld': mysqld. is slow to respond to TCP/IP connections from client programs, there is probably a problem with your DNS. In this case, start note 'mysqld': mysqld. with the 'skip_name_resolve' system variable enabled and use only 'localhost' and IP addresses in the 'Host' column of the MySQL grant tables. (Be sure that an account exists that specifies an IP address or you may not be able to connect.)

You can force a MySQL client to use a named-pipe connection rather than TCP/IP by specifying the '--pipe' or '--protocol=PIPE' option, or by specifying '.' (period) as the host name. Use the '--socket' option to specify the name of the pipe if you do not want to use the default pipe name.

If you have set a password for the 'root' account, deleted the anonymous account, or created a new user account, then to connect to the MySQL server you must use the appropriate '-u' and '-p' options with the commands shown previously. See *note connecting::.

For more information about note 'mysqlshow': mysqlshow, see note mysqlshow::.

 File: manual.info.tmp, Node: windows-troubleshooting, Next: windows-postinstallation, Prev: windows-install-archive, Up: windows-installation

2.3.5 Troubleshooting a Microsoft Windows MySQL Server Installation

When installing and running MySQL for the first time, you may encounter certain errors that prevent the MySQL server from starting. This section helps you diagnose and correct some of these errors.

Your first resource when troubleshooting server issues is the error log. The MySQL server uses the error log to record information relevant to the error that prevents the server from starting. The error log is located in the data directory specified in your 'my.ini' file. The default data directory location is 'C:FilesServer 5.7', or 'C:' on Windows 7 and Windows Server 2008. The 'C:' directory is hidden by default. You need to change your folder options to see the directory and contents. For more information on the error log and understanding the content, see *note error-log::.

For information regarding possible errors, also consult the console messages displayed when the MySQL service is starting. Use the 'SC START MYSQLD_SERVICE_NAME' or 'NET START MYSQLD_SERVICE_NAME' command from the command line after installing note 'mysqld': mysqld. as a service to see any error messages regarding the starting of the MySQL server as a service. See note windows-start-service::.

The following examples show other common error messages you might encounter when installing MySQL and starting the server for the first time:

 File: manual.info.tmp, Node: windows-postinstallation, Next: windows-restrictions, Prev: windows-troubleshooting, Up: windows-installation

2.3.6 Windows Postinstallation Procedures

GUI tools exist that perform most of the tasks described in this section, including:

If necessary, initialize the data directory and create the MySQL grant tables. Windows distributions prior to MySQL 5.7.7 include a data directory with a set of preinitialized accounts in the 'mysql' database. As of 5.7.7, Windows installation operations performed by MySQL Installer initialize the data directory automatically. For installation from a ZIP Archive package, initialize the data directory as described at *note data-directory-initialization::.

Regarding passwords, if you installed MySQL using the MySQL Installer, you may have already assigned a password to the initial 'root' account. (See note mysql-installer::.) Otherwise, use the password-assignment procedure given in note default-privileges::.

Before assigning a password, you might want to try running some client programs to make sure that you can connect to the server and that it is operating properly. Make sure that the server is running (see note windows-server-first-start::). You can also set up a MySQL service that runs automatically when Windows starts (see note windows-start-service::).

These instructions assume that your current location is the MySQL installation directory and that it has a 'bin' subdirectory containing the MySQL programs used here. If that is not true, adjust the command path names accordingly.

If you installed MySQL using MySQL Installer (see *note mysql-installer::), the default installation directory is 'C:FilesServer 5.7':

 C:\> cd "C:\Program Files\MySQL\MySQL Server 5.7"

A common installation location for installation from a ZIP archive is 'C:':

 C:\> cd C:\mysql

Alternatively, add the 'bin' directory to your 'PATH' environment variable setting. That enables your command interpreter to find MySQL programs properly, so that you can run a program by typing only its name, not its path name. See *note mysql-installation-windows-path::.

With the server running, issue the following commands to verify that you can retrieve information from the server. The output should be similar to that shown here.

Use *note 'mysqlshow': mysqlshow. to see what databases exist:

 C:\> bin\mysqlshow
 +--------------------+
 |     Databases      |
 +--------------------+
 | information_schema |
 | mysql              |
 | performance_schema |
 | sys                |
 +--------------------+

The list of installed databases may vary, but always includes at least 'mysql' and 'information_schema'. Before MySQL 5.7.7, a 'test' database may also be created automatically.

The preceding command (and commands for other MySQL programs such as *note 'mysql': mysql.) may not work if the correct MySQL account does not exist. For example, the program may fail with an error, or you may not be able to view all databases. If you install MySQL using MySQL Installer, the 'root' user is created automatically with the password you supplied. In this case, you should use the '-u root' and '-p' options. (You must use those options if you have already secured the initial MySQL accounts.) With '-p', the client program prompts for the 'root' password. For example:

 C:\> bin\mysqlshow -u root -p
 Enter password: (ENTER ROOT PASSWORD HERE)
 +--------------------+
 |     Databases      |
 +--------------------+
 | information_schema |
 | mysql              |
 | performance_schema |
 | sys                |
 +--------------------+

If you specify a database name, *note 'mysqlshow': mysqlshow. displays a list of the tables within the database:

 C:\> bin\mysqlshow mysql
 Database: mysql
 +---------------------------+
 |          Tables           |
 +---------------------------+
 | columns_priv              |
 | db                        |
 | engine_cost               |
 | event                     |
 | func                      |
 | general_log               |
 | gtid_executed             |
 | help_category             |
 | help_keyword              |
 | help_relation             |
 | help_topic                |
 | innodb_index_stats        |
 | innodb_table_stats        |
 | ndb_binlog_index          |
 | plugin                    |
 | proc                      |
 | procs_priv                |
 | proxies_priv              |
 | server_cost               |
 | servers                   |
 | slave_master_info         |
 | slave_relay_log_info      |
 | slave_worker_info         |
 | slow_log                  |
 | tables_priv               |
 | time_zone                 |
 | time_zone_leap_second     |
 | time_zone_name            |
 | time_zone_transition      |
 | time_zone_transition_type |
 | user                      |
 +---------------------------+

Use the *note 'mysql': mysql. program to select information from a table in the 'mysql' database:

 C:\> bin\mysql -e "SELECT User, Host, plugin FROM mysql.user" mysql
 +------+-----------+-----------------------+
 | User | Host      | plugin                |
 +------+-----------+-----------------------+
 | root | localhost | mysql_native_password |
 +------+-----------+-----------------------+

For more information about note 'mysql': mysql. and note 'mysqlshow': mysqlshow, see note mysql::, and note mysqlshow::.

 File: manual.info.tmp, Node: windows-restrictions, Prev: windows-postinstallation, Up: windows-installation

2.3.7 Windows Platform Restrictions

The following restrictions apply to use of MySQL on the Windows platform:

 File: manual.info.tmp, Node: macos-installation, Next: linux-installation, Prev: windows-installation, Up: installing