Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple MySQL instances on a single machine [closed]

How to configure multiple MySQL instances on a single machine? There are a lot of information on the web, but they are not very useful.

Instead of generic information that can only be understood by a mind with years of MySQL administrative experience, I am looking for a tutorial that guides me from begin to end. I would appreciate answers or pointers that are self-sufficient, i.e., don't require a lot of knowledge from the user's part, instead of obscure references.

like image 534
Graviton Avatar asked Jan 15 '09 16:01

Graviton


People also ask

Can you run multiple MySQL servers on a single machine?

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.

Can you have multiple MySQL databases?

Within an Azure Database for MySQL server, you can create one or multiple databases. You can opt to create a single database per server to use all the resources or to create multiple databases to share the resources.

Can I have 2 versions of MySQL?

This indicates that using the MySQL community installer, we can install a different version of MySQL but cannot install multiple instances of the same version. To run multiple instances, the second instance of MySQL must install as a windows service. The installation must be performed manually using a command prompt.


1 Answers

OK, this question should be closed as not-programming-related, this is really a question for the upcoming "sister" site but I'm going to try and answer it anyway. Now I've never used MySQL and someone can probably do a better answer.

Lets start with a google search

(5 mins later... decided to take the plunge after only skim reading a couple of results)

  • download + install mysql essential package (mysql-essential-5.1.30-win32.msi)
  • run configuration wizard
  • run configuration wizard again (modifying db path, port no)
  • take a look at http://dev.mysql.com/doc/refman/5.1/en/multiple-windows-services.html
  • take a look at my.ini (and the backup)
  • figure out that I need to make a copy of the data dir and merge ini with backup ini file and didn't need to run the config wizard twice. Should have just edited the INI to begin with (but that would require reading the manual.. too much work! Ini file is pretty well documented anyway though)
  • merge ini files, make service name modifications
  • run commands: mysqld --install mysql1, mysqld --install mysql2, net start mysql1, net start mysql2

20 mins, done.

Now we have step by step instructions for running multiple MySQL instances on a single machine, which will probably turn up as the first result in google next time anyone searches for it ;)

like image 110
saschabeaumont Avatar answered Oct 15 '22 05:10

saschabeaumont