Most Useful links : http://www.ayni.com/mysql/installing.html#binary-installationhttp://marc.vos.net/howto/mysqlmulti/http...
INFA2 : (In Second Instance Folder)Step 3:To create your custom ini file copy my.ini file and edit.Copy my.ini InstancesIN...
Step: 5Change base dir and data dir in both new instances i.e, INFA1.ini and INFA2.ini files.INFA1.ini FileINFA2.ini File:...
Step :7 New instances Service startupNow go to Control Panel → Administrative tools → Services. Then search for ‘INFA1’ &“...
Another process for connecting new instance.Command : Mysql –u root –h 127.0.0.1 –P 33076. Assign password to new mysql in...
Here new instance is called 3308Command : mysql –u root –P 3308
Here existing and default instance is called 3306Command : mysql –u root -p –P 3306To remove the instances enter the follo...
Start and stop for Mysql service or Instances in windows :C:net start INFA1C:net stop INFA1C:net start INFA2C:net stop INF...
You can stop the MySQL server by executing this command:C:Program FilesMySQLMySQL Server 5.5binmysqladmin -u root –p shutd...
Cannot find the file specified:When I try to start that service “System error has occurred.The system cannot find the file...
The process terminated unexpectedly.Cant find messagefile E:softsmysqlinstancesproductionshareerrmsg.sysFix:Just copy errm...
Multiple instance on windows
Upcoming SlideShare
Loading in …5
×

Multiple instance on windows

2,640 views

Published on

Multiple instance on windows

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,640
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Multiple instance on windows

  1. 1. Most Useful links : http://www.ayni.com/mysql/installing.html#binary-installationhttp://marc.vos.net/howto/mysqlmulti/http://www.packtpub.com/article/running-multiple-mysql-server-instances-parallel-linux-serverhttp://news.softpedia.com/news/Create-MySQL-database-backup-63224.shtmlMultiple instances in windowsStep 1:Create [InstancesINFA1 with in “MySQL” installed directory (you can createanywhere).Better do everything in command prompt.Eg :Cd software locationmysqlmd InstancesINFA1Here we create Instance folder in that “INFA1” and “INFA2” is new instance names.Step: 2Copy your data and share folder to INFOR1 and INFOR2 Folders:Copy data InstancesINFA1Copy share InstancesINFA2INFOR1: ( In First Instance Folder)
  2. 2. INFA2 : (In Second Instance Folder)Step 3:To create your custom ini file copy my.ini file and edit.Copy my.ini InstancesINFA1.iniCopy my.ini InstancesINFA2.iniStep: 4Open INFOR1.ini and change port as 3307 under [client] and [mysqld] section.Like that INFOR2.ini and change port as 3308 under [client] and [mysqld] Section.
  3. 3. Step: 5Change base dir and data dir in both new instances i.e, INFA1.ini and INFA2.ini files.INFA1.ini FileINFA2.ini File:INFA2.iniAnd also make sure change“innodb_data_home_dir “ also in both InstancesStep 6 :Now add your custom.ini in system startup :C:>mysqld --install INFA1 --defaults-file="C:Program FilesMySQLMySQL Server 5.5InstancesINFA1.iniService successfully installed.C:>mysqld --install INFA2 --defaults-file="C:Program FilesMySQLMySQL Server 5.5InstancesINFA2.iniService successfully installed.
  4. 4. Step :7 New instances Service startupNow go to Control Panel → Administrative tools → Services. Then search for ‘INFA1’ &“INFA2”, Then start service.(OR)In cmd prompt run this following command.datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"Error :system error 2 has occurred.The system cannot find the file specified.C: net start INFA1C:net start INFA2Login to individual mysql server using following commandHere new instance is called 3307Command : mysql –u root –P 3307mysql -u root -h localhost -P 3307 [change your port name]mysql -u root -h localhost -P 3307 -p [ if you have password for root ]
  5. 5. Another process for connecting new instance.Command : Mysql –u root –h 127.0.0.1 –P 33076. Assign password to new mysql instanceshell> mysqladmin -S /var/lib/mysql2/mysql.sock -u root password newpass
  6. 6. Here new instance is called 3308Command : mysql –u root –P 3308
  7. 7. Here existing and default instance is called 3306Command : mysql –u root -p –P 3306To remove the instances enter the following commands.mysqld --remove “Instance-1"mysqld --remove "Instance-2"mysqld --remove "Instance-3"C:Program FilesMySQLMySQL Server 5.5bin>mysqld --remove INFA1Service successfully removed.C:Program FilesMySQLMySQL Server 5.5bin>mysqld --remove INFA2Service successfully removed.
  8. 8. Start and stop for Mysql service or Instances in windows :C:net start INFA1C:net stop INFA1C:net start INFA2C:net stop INFA2Set password for each port on mysqlConnect particular port (Like 3307,3308----)Run the following command:Mysql –u root –h 127.0.0.1 –P 3307Mysql >UPDATE user SET Password=PASSWORD(YOURNEWPASSWORD)WHERE User=root;Mysql>FLUS H PRIVILEGES;
  9. 9. You can stop the MySQL server by executing this command:C:Program FilesMySQLMySQL Server 5.5binmysqladmin -u root –p shutdownC:Program FilesMySQLMySQL Server 5.5bin>mysqladmin --port=3307 shutdownC:Program FilesMySQLMySQL Server 5.5bin>mysql -u root -h 127.0.0.1 -P 3307C:Program FilesMySQLMySQL Server 5.5bin>mysqladmin --port=3308 shutdownTo see a list of the privileges that have been granted to a specific user:Select * from mysq.user where user=’username’;
  10. 10. Cannot find the file specified:When I try to start that service “System error has occurred.The system cannot find the file specified.”Open your registry editor at:1. Start → Run2. type ‘regedit’ and enter.3. Next, browse to the registry keynamed: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesmysqldproductionImagePath4. Now you can see there is no double quotes in that –defaults-file so change ImagePath too"E:softsmysqlbinmysqld" --defaults-file="E:softsmysqlinstancesproduction.ini" mysqldproduction5. Now start that service.Keep watching Event Logger. That is the best place to get debug information. Again error whilestarting serverEvent viewer for mysqlCan’t find messagefile:The error isSystem error 1067 has occurred.
  11. 11. The process terminated unexpectedly.Cant find messagefile E:softsmysqlinstancesproductionshareerrmsg.sysFix:Just copy errmsg.sys file from [MYSQL_BASE]shareenglish to that instancesproductionsharefolderNow everything is fine. Service will start successfully.

×