2

Which is a better way to install multiple instances of MySQL / MariaDB / etc on a single Windows box?

  • Manually setting different ports?

  • Docker?

  • Virtual Box?

  • Something else? (Sandbox, mysql_multi, etc, seem to fail on Windows.)

Once they are installed, I intend to write a Perl script to iterate through the instances to get timings (etc) for comparison. So, they need to be accessible in some manner from a single thread.

(I can figure out the settings, RAM, disk, etc; it's just the installs that I am looking for advice on.)

2 Answers 2

2

Installs of MySQL for Windows is like drudgery but possible

I usually use the no-install zip file.

After installing it in an appropriate location, I go to the bin folder and run

mysqld --install

This creates the service called MySQL.

Please make sure the my.ini is in the parent directory of the bin folder.

Since you are installing different versions of MySQL, you may want to name the services to differentiate the services.

For MariaDB, you probably would do

mysqld --install MariaDB

and then the same for Percona Server and other versions of MySQL

Being the MySQL guy you are, I know you got the rest from here (just don't forget to assign different port numbers to each my.ini. Ah, you can iterate on port number since you mentioned it in your first bulletpoint)

HAVE FUN WITH IT !!!

2
  • Thank you. Sound like you want to do a MySQL BakeOff : dba.stackexchange.com/questions/3375/…. You should post your results as an answer there. Apr 26, 2016 at 21:50
  • Bakeoff, feature comparison, optimization comparison, etc, etc. But the critical thing is Windows. I talked to Giuseppe about his Sandbox tool -- he said that his sandbox is not worth maintaining; simply use Docker. See DataCharmer. 'mysql_multi' does not work in Windows, etc.
    – Rick James
    Apr 27, 2016 at 3:51
4

Easy, with MariaDB.

mysql_install_db.exe --service=service_name --datadir=datadir --port=port

Run this multiple times with different parameters (service_name, datadir, port should b different for different instances). Start services with "net start " . This is supported official tool. Documentation is here https://mariadb.com/kb/en/mariadb/mysql_install_dbexe/ . You do not need any mysql_multi, really :)

4
  • Is this limited to MariaDB? And won't work with Oracle or Percona?
    – Rick James
    Sep 30, 2016 at 21:27
  • 2
    Limited to MariaDB, (written on a gloomy winter day by yours truly many moons ago). It is used by MariaDB MSI primarily. Percona does not run on Windows at all. MySQL does not have an easy equivalent, as far as I know, although, nowadays you can do some mysqld --initialize-insecure and mysqld --install probably still works. I'm so far unaware of another tool that would create data directory, with my.ini , provide password for root user and register as service in one single command. Sep 30, 2016 at 21:33
  • It may theoretically work with MySQL, at least up to 5.6, if you copy mysql_install_db.exe of corresponding MariaDB version to mysql's bin directory, but I never tried .It needs mysqld executable in the same directory,that understands --bootstrap Sep 30, 2016 at 21:41
  • Thanks. That's the beautiful way to build a script -- minimal args while maximal junk hidden under the covers
    – Rick James
    Sep 30, 2016 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.