MySQL – Cannot Change Directory During Installation

installationMySQLwindows

I try to install mysql db server on windows 10.

Version mysql-installer-community-5.7.16.0.msi

During the installation Install MSI does not offer to change the installation directory.

Do I correctly understand that I can't change the installation directory during the installation process?

Best Answer

There are two methods available, either use ZIP archive to install or you may have to change the datadir variable in my.ini after installation. You can use following steps

  1. Complete the installation

  2. Identify the config file and then look for related datadir being used, you may used mysql>show variables like ‘datadir’ within mysql to identify datadir or the service details for concerned my.ini

  3. Stop the service if it is already running

  4. Change the value of datadir in my.ini, it is usually placed under C:\ProgramData\MySQL

  5. Copy/move the folder contents to newer location

  6. Make sure permissions are provided to user who owns mysql service
  7. Start service and verify using mysql>show variables like ‘datadir’

Hope it helps