Windows»MySql for Windows»Install 32 or 64 bit MySQL 5.5»Edit my.ini to support multipl…
  • RSS Feed

Last modified on 12/13/2020 12:57 PM by User.

Tags:

Edit my.ini to support multiple services of MySQL

  • The installation created the "C:\Program files\MySQL\MySQL SERVER 5.5\my.ini" file.  Here is how you should edit the file to support multiple services:
  • You should comment out the original datadir and port parameters in the [mysqld] section of the my.ini file.
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
#port=3306


#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"

#Path to the database root
#datadir="C:/Program Files/MySQL/MySQL Server 5.5/Data/"

 
  • The other parms in the [mysqld] section above will serve as common values for all services.
  • Now add a new group section to the bottom of the my.ini file, [mysql55_xxx] and give it a unique port#  and datadir.  You should be able to copy paste the lines below directly into the my.ini file. These sections will be specific to individual services.  Of course you should adjust the names and paths below to match your real customers.
#-------------------------------------------------------------------
# options for mysql55_xxx service (use forward slashes in path)
#-------------------------------------------------------------------
[mysql55_xxx]
datadir = C:/u/mvs/xxx/mysql/data
port = 3306   

#-------------------------------------------------------------------
# - When you need a new service, make a copy of the last service above 
# and change the service name, datadir and port for the new service.
# - Find the default data folder datadir= parm in the [mysqld] section of my.ini and copy that folder to the C:\mvs\new\mysql folder
# example: copy "C:\Program files\MySQL\MySQL Server 5.5\Data"  C:\u\mvs\new\mysql
# - You must then create the new service by typing this into a DOS command:
# "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install mysql55_new --defaults-file="c:\Program files\MySQL\MYSQ Server 5.5\my.ini"
#                                                       change this----->^^^
#
# - Then go into Services and start the mysql55_new service and make it launch automatically.
#-------------------------------------------------------------------