PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.3Kb
Man Pages (Zip) - 402.5Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0
On Windows, a MySQL server can run as a Windows service. The procedures for installing, controlling, and removing a single MySQL service are described inSection 2.3.4.8, “Starting MySQL as a Windows Service”.
To set up multiple MySQL services, you must make sure that each instance uses a different service name in addition to the other parameters that must be unique per instance.
For the following instructions, suppose that you want to run themysqld server from two different versions of MySQL that are installed atC:\mysql-5.7.9 andC:\mysql-8.0.45, respectively. (This might be the case if you are running 5.7.9 as your production server, but also want to conduct tests using 8.0.45.)
To install MySQL as a Windows service, use the--install or--install-manual option. For information about these options, seeSection 2.3.4.8, “Starting MySQL as a Windows Service”.
Based on the preceding information, you have several ways to set up multiple services. The following instructions describe some examples. Before trying any of them, shut down and remove any existing MySQL services.
Approach 1: Specify the options for all services in one of the standard option files. To do this, use a different service name for each server. Suppose that you want to run the 5.7.9mysqld using the service name of
mysqld1and the 8.0.45mysqld using the service namemysqld2. In this case, you can use the[mysqld1]group for 5.7.9 and the[mysqld2]group for 8.0.45. For example, you can set upC:\my.cnflike this:# options for mysqld1 service[mysqld1]basedir = C:/mysql-5.7.9port = 3307enable-named-pipesocket = mypipe1# options for mysqld2 service[mysqld2]basedir = C:/mysql-8.0.45port = 3308enable-named-pipesocket = mypipe2Install the services as follows, using the full server path names to ensure that Windows registers the correct executable program for each service:
C:\> C:\mysql-5.7.9\bin\mysqld --install mysqld1C:\> C:\mysql-8.0.45\bin\mysqld --install mysqld2To start the services, use the services manager, orNET START orSC START with the appropriate service names:
C:\> SC START mysqld1C:\> SC START mysqld2To stop the services, use the services manager, or useNET STOP orSC STOP with the appropriate service names:
C:\> SC STOP mysqld1C:\> SC STOP mysqld2Approach 2: Specify options for each server in separate files and use
--defaults-filewhen you install the services to tell each server what file to use. In this case, each file should list options using a[mysqld]group.With this approach, to specify options for the 5.7.9mysqld, create a file
C:\my-opts1.cnfthat looks like this:[mysqld]basedir = C:/mysql-5.7.9port = 3307enable-named-pipesocket = mypipe1For the 8.0.45mysqld, create a file
C:\my-opts2.cnfthat looks like this:[mysqld]basedir = C:/mysql-8.0.45port = 3308enable-named-pipesocket = mypipe2Install the services as follows (enter each command on a single line):
C:\> C:\mysql-5.7.9\bin\mysqld --install mysqld1 --defaults-file=C:\my-opts1.cnfC:\> C:\mysql-8.0.45\bin\mysqld --install mysqld2 --defaults-file=C:\my-opts2.cnfWhen you install a MySQL server as a service and use a
--defaults-fileoption, the service name must precede the option.After installing the services, start and stop them the same way as in the preceding example.
To remove multiple services, useSC DELETEmysqld_service_name for each one. Alternatively, usemysqld --remove for each one, specifying a service name following the--remove option. If the service name is the default (MySQL), you can omit it when usingmysqld --remove.
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.3Kb
Man Pages (Zip) - 402.5Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
Security in MySQL
Starting and Stopping MySQL
MySQL and Linux/Unix
MySQL and Windows
MySQL and macOS
MySQL and Solaris
Building MySQL from Source
MySQL Restrictions and Limitations
MySQL Partitioning
MySQL Tutorial
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL NDB Cluster 8.0