Running Multiple MySQL Instances on One Machine 5.8 Running Multiple MySQL Instances on One Machine In some cases, you might want to run multiple instances of MySQL on a single machine. You might want to test a new MySQL release while leaving an existing production setup undisturbed. Or you might want to give different users access to different  mysqld  servers that they manage themselves. (For example, you might be an Internet Service Provider that wants to provide independent MySQL installations for different customers.) It is possible to use a different MySQL server binary per instance, or use the same binary for multiple instances, or any combination of the two approaches. For example, you might run a server from MySQL 5.7 and one from MySQL 8.0, to see how different versions handle a given workload. Or you might run multiple instances of the current production version, each managing a different set of databases. Whether or not you use distinct server binaries, each instance that you run must be configured with unique values for several operating parameters. This eliminates the potential for conflict between instances. Parameters can be set on the command line, in option files, or by setting environment variables. See Section 4.2.2, “Specifying Program Options” . To see the values used by a given instance, connect to it and execute a  SHOW VARIABLES  statement. The primary resource managed by a MySQL instance is the data directory. Each instance should use a different data directory, the location of which is specified using the  --datadir= dir_name  option. For methods of configuring each instance with its own data directory, and warnings about the dangers of failing to do so, see Section 5.8.1, “Setting Up Multiple Data Directories” . In addition to using different data directories, several other options must have different values for each server instance: --port  controls the port number for TCP/IP connections. Alternatively, if the host has multiple network addresses, you can set the  bind_address  system variable to cause each server to listen to a different address. --socket  controls the Unix socket file path on Unix or the named-pipe name on Windows. On Windows, it is necessary to specify distinct pipe names only for those servers configured to permit named-pipe connections. This option is used only on Windows. It designates the shared-memory name used by a Windows server to permit clients to connect using shared memory. It is necessary to specify distinct shared-memory names only for those servers configured to permit shared-memory connections. This option indicates the path name of the file in which the server writes its process ID. If you use the following log file options, their values must differ for each server: • --port= port_num • --socket={ file_name | pipe_name } • --shared-memory-base-name= name • --pid-file= file_name • --general_log_file= file_name • --log-bin[= file_name ] • --slow_query_log_file= file_name 1146