Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TWO MYSQL instances in Windows environment

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I encounter problem of running two mySQL instances in Windows environment. In Unix, it works well.

Consider the following scenario :

I have two mysql instances installed in my computer. One is located at C:\MYSQL1> and the other is located at C:\MYSQL2>

1. First I run the server with port 1000, using the following command :

C:\MYSQL1> bin\mysqld --console --port=1000 --socket=.\db1.sock --data=.\data

2. Then I run the server with port 2000, as follows:

C:\MYSQL2> bin\mysqld --console --port=2000 --socket=.\db1.sock --data=.\data

It is successfully executed. I can connect to both ports. But when I want to shutdown one of the ports, say, port 2000, using the following command:

C:\MYSQL2> bin\mysqladmin -u root --port=2000 --socket=.\db2.sock shutdown > log

The port 2000 is not shutdown. Instead the port 1000 is shutdown.

Then I try to open port 2000 first and then open port 1000. When I try to shutdown port 1000, the problem comes. Port 1000 is not shutdown, but port 2000 is shutdown.

No matter what you specify in the port option, the FIRST port that is opened will be shutdown first.

What is the solution for this problem? Anyone can help ? Thanks......
 
A totally uninformed wild guess would be to try copying your mysqld binaries into something like
mysqld1000 and mysql2000
.

Launch the distinct, renamed binaries with the port detail you are already using. I don't know how you'd be able to gracefully kill the processes uniquely in Windows, but it seems that you'd have a fighting chance by targeting 'mysqld2000' instead of letting 'mysqld' make a bad choice for you. However, this is just a guess and the mysql engine may still start culling instances at first load.

This might also be an issue in terms of which mysqld loaded the resident libraries. I though Windows would keep the library ownership straight, but who knows.

Curious though why you're making two instances and the port changes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top